Table of Contents

Create Method

Definition

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

Create<TEntryPoint>(Action<IHostBuilder>, IApplicationFixture<TEntryPoint>)

Creates and returns an IHostTest implementation.

public static IHostTest Create<TEntryPoint>(Action<IHostBuilder> hostSetup = null, IApplicationFixture<TEntryPoint> hostFixture = null) where TEntryPoint : class

Parameters

hostSetup Action<IHostBuilder>

The IHostBuilder which may be configured.

hostFixture IApplicationFixture<TEntryPoint>

An optional IApplicationFixture<TEntryPoint> implementation to use instead of the default ManagedApplicationFixture<TEntryPoint> instance.

Returns

IHostTest

An instance of an IHostTest implementation.

Type Parameters

TEntryPoint

A type in the entry point assembly of the application.

Remarks

When hostFixture is omitted, the factory uses ManagedApplicationFixture<TEntryPoint> so the application entry point owns deferred host startup. Pass another IApplicationFixture<TEntryPoint> implementation when the test requires a different lifecycle.