Interface IHostFixture
- Namespace
- Codebelt.Extensions.Xunit.Hosting
- Assembly
- Codebelt.Extensions.Xunit.Hosting.dll
Provides a way to use Microsoft Dependency Injection in unit tests.
public interface IHostFixture : IServiceTest, IHostTest, IConfigurationTest, IHostingEnvironmentTest, IDisposable, IAsyncDisposable
- Inherited Members
-
IDisposable.Dispose()IAsyncDisposable.DisposeAsync()
Properties
ConfigureCallback
Gets or sets the delegate that adds configuration and environment information to a HostTest<T>.
Action<IConfiguration, IHostEnvironment> ConfigureCallback { get; set; }
Property Value
- Action<IConfiguration, IHostEnvironment>
The delegate that adds configuration and environment information to a HostTest<T>.
ConfigureHostCallback
Gets or sets the delegate that provides a way to override the Microsoft.Extensions.Hosting.IHostBuilder defaults set up by ConfigureHost(Test).
Action<IHostBuilder> ConfigureHostCallback { get; set; }
Property Value
- Action<IHostBuilder>
The delegate that provides a way to override the Microsoft.Extensions.Hosting.IHostBuilder.
ConfigureServicesCallback
Gets or sets the delegate that adds services to the container.
Action<IServiceCollection> ConfigureServicesCallback { get; set; }
Property Value
- Action<IServiceCollection>
The delegate that adds services to the container.
Methods
ConfigureHost(Test)
Creates and configures the Microsoft.Extensions.Hosting.IHost of this IHostFixture.
void ConfigureHost(Test hostTest)
Parameters
hostTest
TestThe object that inherits from HostTest<T>.
Remarks
hostTest
was added to support those cases where the caller is required in the host configuration.