Table of Contents

Class ApplicationTest<TEntryPoint, T>

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

Represents a base class from which all implementations of unit testing, that uses Microsoft Dependency Injection and depends on an existing .NET application entry point, should derive.

public abstract class ApplicationTest<TEntryPoint, T> : HostTest, IAsyncLifetime, IHostTest, IConfigurationTest, IEnvironmentTest, ITest, IDisposable, IAsyncDisposable, IClassFixture<T> where TEntryPoint : class where T : class, IApplicationFixture<TEntryPoint>

Type Parameters

TEntryPoint

A type in the entry point assembly of the application.

T

The type of the object that implements the IApplicationFixture<TEntryPoint> interface.

Inheritance
ApplicationTest<TEntryPoint, T>
Implements
IAsyncLifetime
IClassFixture<T>
Inherited Members

Constructors

ApplicationTest(bool, T, ITestOutputHelper, Type)

Initializes a new instance of the ApplicationTest<TEntryPoint, T> class.

protected ApplicationTest(bool skipHostFixtureInitialization, T hostFixture, ITestOutputHelper output = null, Type callerType = null)

Parameters

skipHostFixtureInitialization bool

A value indicating whether to skip the host fixture initialization.

hostFixture T

An implementation of the IApplicationFixture<TEntryPoint> interface.

output ITestOutputHelper

An implementation of the Xunit.ITestOutputHelper interface.

callerType Type

The Type of caller that ends up invoking this instance.

Exceptions

ArgumentNullException

hostFixture is null.

ApplicationTest(T, ITestOutputHelper, Type)

Initializes a new instance of the ApplicationTest<TEntryPoint, T> class.

protected ApplicationTest(T hostFixture, ITestOutputHelper output = null, Type callerType = null)

Parameters

hostFixture T

An implementation of the IApplicationFixture<TEntryPoint> interface.

output ITestOutputHelper

An implementation of the Xunit.ITestOutputHelper interface.

callerType Type

The Type of caller that ends up invoking this instance.

Methods

ConfigureHost(IHostBuilder)

Provides a way to override the IHostBuilder defaults before the application is built.

protected virtual void ConfigureHost(IHostBuilder builder)

Parameters

builder IHostBuilder

The IHostBuilder used to configure the application.

See Also

HostTest
IClassFixture<TFixture>