3 instantiations of TestServer
Microsoft.AspNetCore.Mvc.Testing (3)
WebApplicationFactory.cs (3)
649protected virtual TestServer CreateServer(IWebHostBuilder builder) => new(builder); 663return new(serviceProvider, options); 666return new(serviceProvider);
29 references to TestServer
Microsoft.AspNetCore.Mvc.Testing (19)
WebApplicationFactory.cs (19)
38private TestServer? _server; 51/// create a <see cref="TestServer"/> instance using the MVC application defined by <typeparamref name="TEntryPoint"/> 52/// and one or more <see cref="HttpClient"/> instances used to send <see cref="HttpRequestMessage"/> to the <see cref="TestServer"/>. 85/// Gets the <see cref="TestServer"/> created by this <see cref="WebApplicationFactory{TEntryPoint}"/>. 87public TestServer Server 432_server = (TestServer)_host.Services.GetRequiredService<IServer>(); 603/// Creates a <see cref="IHostBuilder"/> used to set up <see cref="TestServer"/>. 620/// Creates a <see cref="IWebHostBuilder"/> used to set up <see cref="TestServer"/>. 641/// Creates the <see cref="TestServer"/> with the bootstrapped application in <paramref name="builder"/>. 647/// <returns>The <see cref="TestServer"/> with the bootstrapped application.</returns> 649protected virtual TestServer CreateServer(IWebHostBuilder builder) => new(builder); 652/// Creates the <see cref="TestServer"/> with the <see cref="IServiceProvider"/> from the bootstrapped application. 658protected virtual TestServer CreateServer(IServiceProvider serviceProvider) 914private readonly Func<IWebHostBuilder, TestServer> _createServer; 915private readonly Func<IServiceProvider, TestServer> _createServerFromServiceProvider; 924Func<IWebHostBuilder, TestServer> createServer, 925Func<IServiceProvider, TestServer> createServerFromServiceProvider, 945protected override TestServer CreateServer(IWebHostBuilder builder) => _createServer(builder); 947protected override TestServer CreateServer(IServiceProvider serviceProvider) => _createServerFromServiceProvider(serviceProvider);
Microsoft.AspNetCore.TestHost (10)
HostBuilderTestServerExtensions.cs (2)
21public static TestServer GetTestServer(this IHost host) 23return (TestServer)host.Services.GetRequiredService<IServer>();
RequestBuilder.cs (2)
20public RequestBuilder(TestServer server, string path) 29public TestServer TestServer { get; }
WebHostBuilderExtensions.cs (6)
23/// Enables the <see cref="TestServer" /> service. 32services.AddSingleton<IServer, TestServer>(); 37/// Enables the <see cref="TestServer" /> service. 48services.AddSingleton<IServer, TestServer>(); 58public static TestServer GetTestServer(this IWebHost host) 60return (TestServer)host.Services.GetRequiredService<IServer>();