I\'m trying to test my controllers using xUnit
but getting the following error during execution of Customer Controller:
\"The following constr
This article shows how to get xunit working with .Net Core ASP.Net really well. It actually replaces the startup so that your controllers run in the same process, and you can test them as if they were local.
https://docs.microsoft.com/en-us/aspnet/core/test/integration-tests
It allows your standard .Net Dependency Injection to work as it normally does. Moreover it has the amazing benefit of not running as a server, and it fakes the whole startup process so that it runs in one single process and you can debug all the way through. This is also the way you should do it because Microsoft says so.
There's more help to be gleaned from the forum at the bottom of the article.