Class HostFixture
- Namespace
- Cuemon.Extensions.Xunit.Hosting
- Assembly
- Cuemon.Extensions.Xunit.Hosting.dll
Provides a default implementation of the IHostFixture interface.
public class HostFixture : Disposable, IDisposable, IHostFixture, IServiceTest, IHostTest, IConfigurationTest, IHostingEnvironmentTest
- Inheritance
-
ObjectHostFixture
- Implements
-
IDisposable
- Derived
- Inherited Members
Constructors
HostFixture()
Initializes a new instance of the HostFixture class.
public HostFixture()
Properties
Configuration
Gets the Microsoft.Extensions.Configuration.IConfiguration initialized by this instance.
public IConfiguration Configuration { get; protected set; }
Property Value
- IConfiguration
The Microsoft.Extensions.Configuration.IConfiguration initialized by this instance.
ConfigureCallback
Gets or sets the delegate that initializes the test class.
public Action<IConfiguration, IHostEnvironment> ConfigureCallback { get; set; }
Property Value
- Action<IConfiguration, IHostEnvironment>
The delegate that initializes the test class.
Remarks
Mimics the Startup convention.
ConfigureHostCallback
Gets or sets the delegate that initializes the host builder.
public Action<IHostBuilder> ConfigureHostCallback { get; set; }
Property Value
- Action<IHostBuilder>
The delegate that initializes the host builder.
ConfigureServicesCallback
Gets or sets the delegate that adds services to the container.
public Action<IServiceCollection> ConfigureServicesCallback { get; set; }
Property Value
- Action<IServiceCollection>
The delegate that adds services to the container.
Host
Gets or sets the Microsoft.Extensions.Hosting.IHost initialized by this instance.
public IHost Host { get; protected set; }
Property Value
- IHost
The Microsoft.Extensions.Hosting.IHost initialized by this instance.
HostingEnvironment
Gets the Microsoft.Extensions.Hosting.IHostEnvironment initialized by this instance.
public IHostEnvironment HostingEnvironment { get; protected set; }
Property Value
- IHostEnvironment
The Microsoft.Extensions.Hosting.IHostEnvironment initialized by this instance.
ServiceProvider
Gets the System.IServiceProvider initialized by this instance.
public IServiceProvider ServiceProvider { get; }
Property Value
- IServiceProvider
The System.IServiceProvider initialized by this instance.
Methods
ConfigureHost(Test)
Creates and configures the Microsoft.Extensions.Hosting.IHost of this instance.
public virtual 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.
Exceptions
- System.ArgumentNullException
hostTest
is null.- System.ArgumentOutOfRangeException
hostTest
is not assignable from HostTest<T>.
OnDisposeManagedResources()
Called when this object is being disposed by either Dispose() or Dispose(Boolean) having disposing
set to true
and Disposed is false
.
protected override void OnDisposeManagedResources()