你的位置: 码友网首页 / 资讯源列表 / Integration Testing with ASP.NET Core 3.1 - Set Default Headers for All Clients

关于[Integration Testing with ASP.NET Core 3.1 - Set Default Headers for All Clients]的摘要:

When setting up a custom WebApplicationFactory to allow for testing a REST based API end point you may have the requirement of always needing to send a specific header in with the request. This can be in relation to a specific user agent or an api key etc. depending on the implementation. Adding this into the client in every test can get repeatative so in this post I will show you a way of reducing code duplication.

原文地址: https://adamstorr.azurewebsites.net/blog/integration-testing-with-aspnetcore-3-1-set-default-headers-for-all-clients

收录时间: 2020-10-21 浏览量: 1176 分类: ASP.NET Core

| 0 收藏 | 0