Table of Contents

Class ConsoleDiagnosticMessageSink

Namespace
Xunit.Runner.Common
Assembly
xunit.v3.runner.common.dll

Logs diagnostic messages to the system console.

public class ConsoleDiagnosticMessageSink : IMessageSink
Inheritance
ConsoleDiagnosticMessageSink
Implements
Inherited Members

Methods

OnMessage(IMessageSinkMessage)

Reports the presence of a message on the message bus. This method should never throw exceptions.

public bool OnMessage(IMessageSinkMessage message)

Parameters

message IMessageSinkMessage

The message from the message bus

Returns

bool

Return true to continue running tests, or false to stop.

TryCreate(ConsoleHelper, bool, bool, bool, string?, bool)

Tries to create a new instance of the ConsoleDiagnosticMessageSink which will display instances of IDiagnosticMessage and IInternalDiagnosticMessage to the Console. May return null if both showDiagnosticMessages and showInternalDiagnosticMessages are false.

public static ConsoleDiagnosticMessageSink? TryCreate(ConsoleHelper consoleHelper, bool noColor, bool showDiagnosticMessages = false, bool showInternalDiagnosticMessages = false, string? assemblyDisplayName = null, bool indent = true)

Parameters

consoleHelper ConsoleHelper

The helper used to write console messages

noColor bool

A flag to indicate that the user has asked for no color

showDiagnosticMessages bool

A flag to indicate whether diagnostic messages should be shown

showInternalDiagnosticMessages bool

A flag to indicate whether internal diagnostic messages should be shown

assemblyDisplayName string

The optional assembly display name to delineate the messages

indent bool

Whether to indent the message

Returns

ConsoleDiagnosticMessageSink