You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The intention is to avoid creating a separate TestStartUp class rather - rather inject an instance of Configuration
Sample start up below,
public class Startup
{
public IConfiguration Configuration {get; set;}
public void Startup()
{
Configuration = new ConfigurationBuilder()
.AddEnvironmentVariables()
.Build();
}
public void ConfigureServices(IServiceCollection services)
{
//uses Configuration object to set up everything
}
}
In the above implementation, if only
TestServer.CreateBuilder().UseStartup(instanceOfStartup)
is permitted
I can do this,
Startup instanceOfStartup= new Startup();
instanceOfStartup.Configuration = myOwnconfigurationWithKeysRequiredForTest;
//create a test server with
TestServer.CreateBuilder().UseStartup(instanceOfStartup)
Advantage: I dont have to maintain multiple startup class.
Does it make sense?
The text was updated successfully, but these errors were encountered:
The intention is to avoid creating a separate TestStartUp class rather - rather inject an instance of Configuration
Sample start up below,
In the above implementation, if only
TestServer.CreateBuilder().UseStartup(instanceOfStartup)
is permitted
I can do this,
Advantage: I dont have to maintain multiple startup class.
Does it make sense?
The text was updated successfully, but these errors were encountered: