3 instantiations of TestServer
Microsoft.AspNetCore.Mvc.Testing (3)
WebApplicationFactory.cs (3)
649
protected virtual TestServer CreateServer(IWebHostBuilder builder) =>
new
(builder);
663
return
new
(serviceProvider, options);
666
return
new
(serviceProvider);
29 references to TestServer
Microsoft.AspNetCore.Mvc.Testing (19)
WebApplicationFactory.cs (19)
38
private
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}"/>.
87
public
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>
649
protected virtual
TestServer
CreateServer(IWebHostBuilder builder) => new(builder);
652
/// Creates the <see cref="
TestServer
"/> with the <see cref="IServiceProvider"/> from the bootstrapped application.
658
protected virtual
TestServer
CreateServer(IServiceProvider serviceProvider)
914
private readonly Func<IWebHostBuilder,
TestServer
> _createServer;
915
private readonly Func<IServiceProvider,
TestServer
> _createServerFromServiceProvider;
924
Func<IWebHostBuilder,
TestServer
> createServer,
925
Func<IServiceProvider,
TestServer
> createServerFromServiceProvider,
945
protected override
TestServer
CreateServer(IWebHostBuilder builder) => _createServer(builder);
947
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>();