Table of Contents

Class HostTest

Namespace
Codebelt.Extensions.Xunit.Hosting
Assembly
Codebelt.Extensions.Xunit.Hosting.dll

Represents the non-generic base class from where its generic equivalent should derive.

public abstract class HostTest : Test, IAsyncLifetime, IHostTest, IConfigurationTest, IEnvironmentTest, ITest, IDisposable, IAsyncDisposable
Inheritance
HostTest
Implements
IAsyncLifetime
Derived
Inherited Members

Constructors

HostTest(ITestOutputHelper, Type)

Initializes a new instance of the HostTest class.

protected HostTest(ITestOutputHelper output = null, Type callerType = null)

Parameters

output ITestOutputHelper

An implementation of the Xunit.ITestOutputHelper interface.

callerType Type

The Type of caller that ends up invoking this instance.

Properties

Configuration

Gets the IConfiguration initialized by the IHost.

public IConfiguration Configuration { get; protected set; }

Property Value

IConfiguration

The IConfiguration initialized by the IHost.

Environment

Gets the IHostEnvironment initialized by the IHost.

public IHostEnvironment Environment { get; protected set; }

Property Value

IHostEnvironment

The IHostEnvironment initialized by the IHost.

Host

Gets the IHost initialized by the IGenericHostFixture.

public IHost Host { get; protected set; }

Property Value

IHost

The IHost initialized by the IGenericHostFixture.

Remarks

For an entry-point-owned host captured by the managed application fixture path, accessing the host starts it when the application entry point has not started it yet. This keeps the opt-in entrypoint-owned applications lazy while matching the startup behavior of WebApplicationFactory when its server is consumed.

Methods

Configure(IConfiguration, IHostEnvironment)

Adds Configuration and Environment to this instance.

public virtual void Configure(IConfiguration configuration, IHostEnvironment environment)

Parameters

configuration IConfiguration

The IConfiguration initialized by the IHost.

environment IHostEnvironment

The IHostEnvironment initialized by the IHost.

See Also