Table of Contents

Class GenericHostTestFactory

Namespace
Cuemon.Extensions.Xunit.Hosting
Assembly
Cuemon.Extensions.Xunit.Hosting.dll

Provides a set of static methods for Microsoft.Extensions.Hosting.IHost unit testing.

public static class GenericHostTestFactory
Inheritance
Object
GenericHostTestFactory

Methods

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

Creates and returns an IGenericHostTest implementation.

public static IGenericHostTest Create(Action<IServiceCollection> serviceSetup = null, Action<IHostBuilder> hostSetup = null)

Parameters

serviceSetup Action<IServiceCollection>

The Microsoft.Extensions.DependencyInjection.IServiceCollection which may be configured.

hostSetup Action<IHostBuilder>

The Microsoft.Extensions.Hosting.IHostBuilder which may be configured.

Returns

IGenericHostTest

An instance of an IGenericHostTest implementation.

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

Creates and returns an IGenericHostTest implementation.

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

Parameters

serviceSetup Action<HostBuilderContext, IServiceCollection>

The Microsoft.Extensions.DependencyInjection.IServiceCollection which may be configured.

hostSetup Action<IHostBuilder>

The Microsoft.Extensions.Hosting.IHostBuilder which may be configured.

Returns

IGenericHostTest

An instance of an IGenericHostTest implementation.