Table of Contents

Class LoggerExtensions

Namespace
Cuemon.Extensions.Xunit.Hosting
Assembly
Cuemon.Extensions.Xunit.Hosting.dll

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

public static class LoggerExtensions
Inheritance
Object
LoggerExtensions

Methods

GetTestStore<T>(ILogger<T>)

Returns the associated ITestStore<T> that is provided when settings up services from AddXunitTestLogging(IServiceCollection, ITestOutputHelper, LogLevel).

public static ITestStore<XunitTestLoggerEntry> GetTestStore<T>(this ILogger<T> logger)

Parameters

logger ILogger<T>

The Microsoft.Extensions.Logging.ILogger<TCategoryName> from which to retrieve the ITestStore<T>.

Returns

ITestStore<XunitTestLoggerEntry>

Returns an implementation of ITestStore<T> with all logged entries expressed as XunitTestLoggerEntry.

Type Parameters

T

Exceptions

System.ArgumentNullException

logger cannot be null.

System.ArgumentException

logger does not contain a test store.