Table of Contents

Class FakeLoggerFixture<TEntryPoint>

Namespace
FEFF.TestFixtures.AspNetCore
Assembly
FEFF.TestFixtures.AspNetCore.dll

Replaces the ILoggerProvider service with a Microsoft.Extensions.Logging.Testing.FakeLoggerProvider singleton in the application under test. Provides a Microsoft.Extensions.Logging.Testing.FakeLogCollector for exploring captured application log output in tests.

public class FakeLoggerFixture<TEntryPoint> : IDisposable where TEntryPoint : class

Type Parameters

TEntryPoint

The application entry point type.

Inheritance
FakeLoggerFixture<TEntryPoint>
Implements
Inherited Members

Constructors

FakeLoggerFixture(AppManagerFixture<TEntryPoint>)

Creates a new FakeLoggerFixture<TEntryPoint> and registers the fake logger provider with the application under test.

public FakeLoggerFixture(AppManagerFixture<TEntryPoint> app)

Parameters

app AppManagerFixture<TEntryPoint>

The application manager fixture.

Properties

Collector

Gets the collector for retrieving captured log entries.

public FakeLogCollector Collector { get; }

Property Value

FakeLogCollector

LoggerProvider

Gets the Microsoft.Extensions.Logging.Testing.FakeLoggerProvider as an ILoggerProvider.

public ILoggerProvider LoggerProvider { get; }

Property Value

ILoggerProvider

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Dispose(bool)

Releases the resources used by the fixture.

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

true to release both managed and unmanaged resources; false to release only unmanaged resources.