LoggerTest Class

Summary

A simple base test class with logger, logger factory and diagnostic source all wired into the Xunit.Abstractions.ITestOutputHelper.
Assembly
Rocket.Surgery.Extensions.Testing.dll
Namespace
Rocket.Surgery.Extensions.Testing
Interfaces
  • IDisposable
Base Types
  • Object
Derived Types
graph BT Type-->Base0["Object"] Type-.->Interface0["IDisposable"] Type["LoggerTest"] class Type type-node Derived0["AutoFakeTest"]-->Type click Derived0 "/api/Rocket.Surgery.Extensions.Testing/AutoFakeTest" Derived1["AutoSubstituteTest"]-->Type click Derived1 "/api/Rocket.Surgery.Extensions.Testing/AutoSubstituteTest" Derived2["AutoMockTest"]-->Type click Derived2 "/api/Rocket.Surgery.Extensions.Testing/AutoMockTest"

Syntax

public abstract class LoggerTest : IDisposable

Attributes

Type Description
NullableContextAttribute
NullableAttribute
PublicAPIAttribute

Constructors

Name Summary
LoggerTest(ITestOutputHelper, LogEventLevel, string, Action<LoggerConfiguration>) The default constructor with available logging level
LoggerTest(ITestOutputHelper, LogLevel, string, Action<LoggerConfiguration>) The default constructor with available logging level
LoggerTest(ITestOutputHelper, string, Action<LoggerConfiguration>) The default constructor with available logging level

Fields

Name Constant Value Summary
Disposables
The System.Reactive.Disposables.CompositeDisposable

Properties

Name Value Summary
DiagnosticSource DiagnosticSource
Logger ILogger
The Microsoft.Extensions.Logging.ILogger
LoggerFactory ILoggerFactory
The Microsoft.Extensions.Logging.ILoggerFactory
LogStream IObservable<LogEvent>
The System.IObservable`1
SerilogLogger ILogger
The Microsoft.Extensions.Logging.ILogger

Methods

Name Value Summary
CaptureLogs(Func<LogEvent, bool>, IEnumerable<LogEvent>) IDisposable
Capture log outputs until the item is disposed
CaptureLogs(IEnumerable<LogEvent>) IDisposable
Capture log outputs until the item is disposed
CreateLoggerFactory(ILogger, LoggerProviderCollection) ILoggerFactory
Control the way that the serilog logger factory is created.
ExcludeSourceContext(string) void
Filter a given source context from serilog
IncludeSourceContext(string) void
Filter a given source context from serilog

Extension Methods