Search code examples
.netasp.net-core.net-coreintegration-testingasp.net-core-testhost

Integration testing in .net core api 3.1


I am trying to implement integration testing for each API that i have developed in .Net core 3.1 and have followed this link to create test cases for it.

Please find the below test class that i have created for my API.

enter image description here

But while executing i am getting error in this line _server = new TestServer(new WebHostBuilder() .UseStartup<Startup>()); which is as below :

Error

Am i missing anything here ?


Solution

  • This is not an error. its actually an issue in visual studio. please refer https://stackoverflow.com/a/52387048/9524580 will sort out the issue