Table of Contents

Class HostTestFactory

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

Provides a set of static methods for IHost unit testing.

public static class HostTestFactory
Inheritance
HostTestFactory

Methods

Create(Action<IServiceCollection>, Action<IHostBuilder>, IGenericHostFixture)

Creates and returns an IHostTest implementation.

public static IHostTest Create(Action<IServiceCollection> serviceSetup = null, Action<IHostBuilder> hostSetup = null, IGenericHostFixture hostFixture = null)

Parameters

serviceSetup Action<IServiceCollection>

The IServiceCollection which may be configured.

hostSetup Action<IHostBuilder>

The IHostBuilder which may be configured.

hostFixture IGenericHostFixture

An optional IGenericHostFixture implementation to use instead of the default ManagedHostFixture instance.

Returns

IHostTest

An instance of an IHostTest implementation.

CreateWithHostBuilderContext(Action<HostBuilderContext, IServiceCollection>, Action<IHostBuilder>, IGenericHostFixture)

Creates and returns an IHostTest implementation.

public static IHostTest CreateWithHostBuilderContext(Action<HostBuilderContext, IServiceCollection> serviceSetup = null, Action<IHostBuilder> hostSetup = null, IGenericHostFixture hostFixture = null)

Parameters

serviceSetup Action<HostBuilderContext, IServiceCollection>

The IServiceCollection which may be configured.

hostSetup Action<IHostBuilder>

The IHostBuilder which may be configured.

hostFixture IGenericHostFixture

An optional IGenericHostFixture implementation to use instead of the default ManagedHostFixture instance.

Returns

IHostTest

An instance of an IHostTest implementation.