private IServiceProvider GetServiceProvider(WaitService waitService) { var services = new ServiceCollection(); services.AddInstance(waitService); return(TestHelper.CreateServices("RazorWebSite", services)); }
public InlineConstraintTests() { _provider = TestHelper.CreateServices("InlineConstraintsWebSite"); _provider = new ServiceCollection() .AddScoped <ICommandLineArgumentBuilder, DefaultCommandLineArgumentBuilder>() .BuildServiceProvider(_provider); }
private IServiceProvider GetServiceProvider(TestPageExecutionContext pageExecutionContext) { var services = new ServiceCollection(); services.AddInstance(pageExecutionContext); return(TestHelper.CreateServices("RazorInstrumentationWebsite", services)); }
public async Task AutofacDIContainerCanUseMvc(string url, string expectedResponseBody) { // Arrange var provider = TestHelper.CreateServices("AutofacWebSite"); Action <IApplicationBuilder> app = new Startup().Configure; // Act & Assert (does not throw) // This essentially calls into the Startup.Configuration method var server = TestServer.Create(provider, app); // Make a request to start resolving DI pieces var response = await server.CreateClient().GetAsync(url); var actualResponseBody = await response.Content.ReadAsStringAsync(); Assert.Equal(expectedResponseBody, actualResponseBody); }
public async Task AutofacDIContainerCanUseMvc(string url, string expectedResponseBody) { // Arrange var provider = TestHelper.CreateServices("AutofacWebSite"); Action <IBuilder> app = new Startup().Configure; TestServer server = null; HttpResponse response = null; // Act & Assert await Assert.DoesNotThrowAsync(async() => { // This essentially calls into the Startup.Configuration method server = TestServer.Create(provider, app); // Make a request to start resolving DI pieces response = await server.Handler.GetAsync(url); }); var actualResponseBody = new StreamReader(response.Body).ReadToEnd(); Assert.Equal(expectedResponseBody, actualResponseBody); }
public BasicTests() { _provider = TestHelper.CreateServices("BasicWebSite"); }
public ValueProviderTest() { _services = TestHelper.CreateServices("ValueProvidersSite"); }
public CompositeViewEngineTests() { _services = TestHelper.CreateServices("CompositeViewEngine"); }
public RoutingTests() { _services = TestHelper.CreateServices("RoutingWebSite"); }
public InputFormatterTests() { _services = TestHelper.CreateServices("FormatterWebSite"); }