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
consoleHelperThe helper used to write console messages
noColorboolA flag to indicate that the user has asked for no color
showDiagnosticMessagesboolA flag to indicate whether diagnostic messages should be shown
showInternalDiagnosticMessagesboolA flag to indicate whether internal diagnostic messages should be shown
assemblyDisplayNamestringThe optional assembly display name to delineate the messages
indentboolWhether to indent the message