Table of Contents

Class WebHostTest<T>

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

Represents a base class from which all implementations of unit testing, that uses Microsoft Dependency Injection and depends on ASP.NET Core, should derive.

public abstract class WebHostTest<T> : HostTest<T>, IAsyncLifetime, IClassFixture<T>, IWebHostTest, IHostTest, IConfigurationTest, IEnvironmentTest, ITest, IDisposable, IAsyncDisposable, IPipelineTest where T : class, IWebHostFixture

Type Parameters

T

The type of the object that implements the IWebHostFixture interface.

Inheritance
WebHostTest<T>
Implements
IAsyncLifetime
IClassFixture<T>
Inherited Members

Constructors

WebHostTest(T, ITestOutputHelper, Type)

Initializes a new instance of the WebHostTest<T> class.

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

Parameters

hostFixture T

An implementation of the IWebHostFixture interface.

output ITestOutputHelper

An implementation of the Xunit.Abstractions.ITestOutputHelper interface.

callerType Type

The Type of caller that ends up invoking this instance.

WebHostTest(Boolean, T, ITestOutputHelper, Type)

Initializes a new instance of the WebHostTest<T> class.

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

Parameters

skipHostFixtureInitialization Boolean

A value indicating whether to skip the host fixture initialization.

hostFixture T

An implementation of the IWebHostFixture interface.

output ITestOutputHelper

An implementation of the Xunit.Abstractions.ITestOutputHelper interface.

callerType Type

The Type of caller that ends up invoking this instance.

Properties

Application

Gets the Microsoft.AspNetCore.Builder.IApplicationBuilder initialized by the IHost.

public IApplicationBuilder Application { get; protected set; }

Property Value

IApplicationBuilder

The Microsoft.AspNetCore.Builder.IApplicationBuilder initialized by the IHost.

Methods

ConfigureApplication(IApplicationBuilder)

Configures the HTTP request pipeline.

public abstract void ConfigureApplication(IApplicationBuilder app)

Parameters

app IApplicationBuilder

The type that provides the mechanisms to configure the HTTP request pipeline.

See Also