// REVIEW: we can configure services via AppStartup or via hostContext.Services public TestServer(IConfiguration config, IServiceProvider serviceProvider, Action<IApplicationBuilder> configureApp, ConfigureServicesDelegate configureServices) { var hostContext = new HostingContext() { ApplicationName = "Test App", Configuration = config, ServerFactory = this, StartupMethods = new StartupMethods(configureApp, configureServices) }; _appInstance = new HostingEngine(serviceProvider).Start(hostContext); }
public static TestServer Create(IServiceProvider serviceProvider, Action<IApplicationBuilder> configureApp, ConfigureServicesDelegate configureServices) { // REVIEW: do we need an overload that takes Config for Create? var config = new Configuration(); return new TestServer(config, serviceProvider, configureApp, configureServices); }
// TODO: switch to ConfigureDelegate eventually public StartupMethods(Action<IApplicationBuilder> configure, ConfigureServicesDelegate configureServices) { ConfigureDelegate = configure; ConfigureServicesDelegate = configureServices ?? ApplicationStartup.DefaultBuildServiceProvider; }