Table of Contents

MinimalWebHostTest<T> Class

Definition

Namespace
Codebelt.Extensions.Xunit.Hosting.AspNetCore
Assemblies
Codebelt.Extensions.Xunit.Hosting.AspNetCore.dll
Source
src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/MinimalWebHostTest.cs

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

public abstract class MinimalWebHostTest<T> : MinimalHostTest, IAsyncLifetime, IWebHostTest, IHostTest, IConfigurationTest, IEnvironmentTest, ITest, IDisposable, IAsyncDisposable, IPipelineTest, IClassFixture<T> where T : class, IWebMinimalHostFixture

Type Parameters

T

The type of the object that implements the IWebMinimalHostFixture interface.

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

Remarks

The class needed to be designed in this rather complex way, as this is the only way that xUnit supports a shared context. The need for shared context is theoretical at best, but it does opt-in for Scoped instances.

Constructors

Name Description
MinimalWebHostTest(bool, T, ITestOutputHelper, Type)

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

MinimalWebHostTest(T, ITestOutputHelper, Type)

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

Properties

Name Description
Application

Gets the IApplicationBuilder initialized by the IHost.

Methods

Name Description
ConfigureApplication(IApplicationBuilder)

Configures the HTTP request pipeline.

See Also

MinimalHostTest
IWebHostTest
IClassFixture<TFixture>