In my integration tests, I use a TestServer
class to work towards a test server instance for my integration tests. In RC1, I instanciated it using the following code:
var server = new TestServer(TestServer.CreateBuilder().UseStartup<Startup>());
On RC2, TestServer.CreateBuilder() was removed. Therefore, I tried to create a new TestServer using the following code:
var server = new TestServer(new WebHostBuilder().UseStartup<Startup>());
The problem I'm facing is that after RC2, the runtime is unable to resolve dependencies for DI, so that it throws exceptions on the Configure method for the Startup class. The system does however start up if I start the actual server (not the test project). The exception thrown is as following:
System.Exception : Could not resolve a service of type 'ShikashiBot.IShikashiBotManager' for the parameter 'botManager' of method 'Configure' on type 'ShikashiBot.Startup'.
I'm currently using the following package for the test host: Microsoft.AspNetCore.TestHost": "1.0.0-rc2-final