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
IGenericHostFixtureAn optional IGenericHostFixture implementation to use instead of the default ManagedHostFixture instance.
Returns
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
IGenericHostFixtureAn optional IGenericHostFixture implementation to use instead of the default ManagedHostFixture instance.