To setup unit tests in previous versions of .Net Core, I could host my WebApp or WebAPI in a test project the following way:
IHost host = Host.CreateDefaultBuilder()
.ConfigureWebHostDefaults(config =>
{
config.UseStartup<MyWebApp.Startup>();
config.UseUrls("https://localhost:44331/");
...
})
.Build();
The current .Net 6.0 does not use Startup class concept, and thus it could not be referenced. How can host AspNet apps in a test project in a proper and clean way?