3 instantiations of TestServer
Microsoft.AspNetCore.Mvc.Testing (3)
WebApplicationFactory.cs (3)
628
protected virtual TestServer CreateServer(IWebHostBuilder builder) =>
new
(builder);
642
return
new
(serviceProvider, options);
645
return
new
(serviceProvider);
29 references to TestServer
Microsoft.AspNetCore.Mvc.Testing (19)
WebApplicationFactory.cs (19)
37
private
TestServer
? _server;
50
/// create a <see cref="
TestServer
"/> instance using the MVC application defined by <typeparamref name="TEntryPoint"/>
51
/// and one or more <see cref="HttpClient"/> instances used to send <see cref="HttpRequestMessage"/> to the <see cref="
TestServer
"/>.
84
/// Gets the <see cref="
TestServer
"/> created by this <see cref="WebApplicationFactory{TEntryPoint}"/>.
86
public
TestServer
Server
411
_server = (
TestServer
)_host.Services.GetRequiredService<IServer>();
582
/// Creates a <see cref="IHostBuilder"/> used to set up <see cref="
TestServer
"/>.
599
/// Creates a <see cref="IWebHostBuilder"/> used to set up <see cref="
TestServer
"/>.
620
/// Creates the <see cref="
TestServer
"/> with the bootstrapped application in <paramref name="builder"/>.
626
/// <returns>The <see cref="
TestServer
"/> with the bootstrapped application.</returns>
628
protected virtual
TestServer
CreateServer(IWebHostBuilder builder) => new(builder);
631
/// Creates the <see cref="
TestServer
"/> with the <see cref="IServiceProvider"/> from the bootstrapped application.
637
protected virtual
TestServer
CreateServer(IServiceProvider serviceProvider)
894
private readonly Func<IWebHostBuilder,
TestServer
> _createServer;
895
private readonly Func<IServiceProvider,
TestServer
> _createServerFromServiceProvider;
904
Func<IWebHostBuilder,
TestServer
> createServer,
905
Func<IServiceProvider,
TestServer
> createServerFromServiceProvider,
925
protected override
TestServer
CreateServer(IWebHostBuilder builder) => _createServer(builder);
927
protected override
TestServer
CreateServer(IServiceProvider serviceProvider) => _createServerFromServiceProvider(serviceProvider);
Microsoft.AspNetCore.TestHost (10)
HostBuilderTestServerExtensions.cs (2)
21
public static
TestServer
GetTestServer(this IHost host)
23
return (
TestServer
)host.Services.GetRequiredService<IServer>();
RequestBuilder.cs (2)
20
public RequestBuilder(
TestServer
server, string path)
29
public
TestServer
TestServer { get; }
WebHostBuilderExtensions.cs (6)
23
/// Enables the <see cref="
TestServer
" /> service.
32
services.AddSingleton<IServer,
TestServer
>();
37
/// Enables the <see cref="
TestServer
" /> service.
48
services.AddSingleton<IServer,
TestServer
>();
58
public static
TestServer
GetTestServer(this IWebHost host)
60
return (
TestServer
)host.Services.GetRequiredService<IServer>();