Table of Contents

Namespace Cuemon.Extensions.Xunit.Hosting

Assembly: Cuemon.Extensions.Xunit.Hosting.dll

The Cuemon.Extensions.Xunit.Hosting namespace contains types that provides a uniform way of doing unit testing that is used in conjunction with Microsoft Dependency Injection. The namespace relates to the Xunit.Abstractions namespace.

Availability: .NET 8, .NET 6 and .NET Standard 2.0

Complements: xUnit: Shared Context between Tests 🔗

Classes

GenericHostTestFactory

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

HostFixture

Provides a default implementation of the IHostFixture interface.

HostTest<T>

Represents a base class from which all implementations of unit testing, that uses Microsoft Dependency Injection, should derive.

LoggerExtensions

Extension methods for the Microsoft.Extensions.Logging.ILogger<TCategoryName> interface.

ServiceCollectionExtensions

Extension methods for the Microsoft.Extensions.DependencyInjection.IServiceCollection interface.

XunitTestLoggerEntry

Represents a captured log-entry for testing purposes. This record encapsulates the Microsoft.Extensions.Logging.LogLevel, Microsoft.Extensions.Logging.EventId and message.

Interfaces

IConfigurationTest

Represents the members needed for DI testing with support for Configuration.

IGenericHostTest

Represents the members needed for bare-bone DI testing with support for Microsoft.Extensions.Hosting.IHost.

IHostFixture

Provides a way to use Microsoft Dependency Injection in unit tests.

IHostingEnvironmentTest

Represents the members needed for DI testing with support for HostingEnvironment.

IHostTest

Represents the members needed for DI host testing.

IServiceTest

Represents the members needed for DI services testing.