Table of Contents

Method TryCreate

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

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

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