HostTest<T> Class
Definition
- Namespace
- Codebelt.Extensions.Xunit.Hosting
- Assemblies
- Codebelt.Extensions.Xunit.Hosting.dll
Represents a base class from which all implementations of unit testing, that uses Microsoft Dependency Injection, should derive.
public abstract class HostTest<T> : HostTest, IAsyncLifetime, IHostTest, IConfigurationTest, IEnvironmentTest, ITest, IDisposable, IAsyncDisposable, IClassFixture<T> where T : class, IGenericHostFixture
Type Parameters
TThe type of the object that implements the IGenericHostFixture interface.
- Inheritance
-
HostTest<T>
- Implements
-
IAsyncLifetimeIClassFixture<T>
- Derived
- Inherited Members
Remarks
The class needed to be designed in this rather complex way, as this is the only way that xUnit supports a shared context. The need for shared context is theoretical at best, but it does opt-in for Scoped instances.
Constructors
| Name | Description |
|---|---|
| HostTest(bool, T, ITestOutputHelper, Type) | Initializes a new instance of the HostTest<T> class. |
| HostTest(T, ITestOutputHelper, Type) | Initializes a new instance of the HostTest<T> class. |
Methods
| Name | Description |
|---|---|
| ConfigureHost(IHostBuilder) | Provides a way to override the IHostBuilder defaults set up by |
| ConfigureServices(IServiceCollection) | Adds services to the container. |