Table of Contents

WebApplicationTest<TEntryPoint, T> Class

Definition

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

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

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

Type Parameters

TEntryPoint

A type in the entry point assembly of the application.

T

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

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

Constructors

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

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

WebApplicationTest(T, ITestOutputHelper, Type)

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

Properties

Name Description
Server

Gets the TestServer initialized by the Host.

Methods

Name Description
ConfigureWebHost(IWebHostBuilder)

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

See Also

HostTest
IClassFixture<TFixture>