Integration Testing with ASP.NET Core 3.1 – Set Default Headers for All Clients adamstorr.azurewebsites.net
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.
Report Story
Leave Your Comment