Perhaps replace WebApplicationFactory with TestServer in WebApiIntegrationTests as WebApplicationFactory seems to have MVC in the pipeline (based on the namespace).
Potential way to replace it.
var hostBuilder = new HostBuilder()
.ConfigureWebHost(webHost =>
{
webHost.UseTestServer();
webHost.UseStartup<Program>(); // Entry point class
});
var host = hostBuilder.Start();
// Get your DbContext
var dbContext = host.Services.GetRequiredService<YourDbContext>();
// Use dbContext to seed data or verify data
Perhaps replace
WebApplicationFactory
withTestServer
inWebApiIntegrationTests
asWebApplicationFactory
seems to have MVC in the pipeline (based on the namespace).Potential way to replace it.