Class StartupAuthenticatedWebApplicationFactory<TStartup>

Namespace
XBullet.EasyTesting.Hosting
Assembly
XBullet.EasyTesting.dll

An authenticated in-memory host for applications that expose a Startup class instead of a conventional Program.Main entry point.

public class StartupAuthenticatedWebApplicationFactory<TStartup> : AuthenticatedWebApplicationFactory<TStartup>, IDisposable, IAsyncDisposable where TStartup : class

Type Parameters

TStartup

The application Startup type used to configure the in-memory test server.

Inheritance
StartupAuthenticatedWebApplicationFactory<TStartup>
Implements
Inherited Members

Remarks

The host is created directly with TestServer and UseStartup. Derived test hosts can use the same authentication and scenario hooks as AuthenticatedWebApplicationFactory<TEntryPoint> without executing an application entry point.

Methods

ConfigureWebHost(IWebHostBuilder)

Gives a fixture an opportunity to configure the application before it gets built.

protected override void ConfigureWebHost(IWebHostBuilder builder)

Parameters

builder IWebHostBuilder

The IWebHostBuilder for the application.

CreateHostBuilder()

Creates a IHostBuilder used to set up TestServer.

protected override IHostBuilder CreateHostBuilder()

Returns

IHostBuilder

A IHostBuilder instance.

Remarks

The default implementation of this method looks for a public static IHostBuilder CreateHostBuilder(string[] args) method defined on the entry point of the assembly of TEntryPoint and invokes it passing an empty string array as arguments.