Table of Contents

Class MessageSinkMessageExtensions

Namespace
Xunit.Sdk
Assembly
xunit.v3.runner.common.dll

Extension methods for IMessageSinkMessage.

public static class MessageSinkMessageExtensions
Inheritance
MessageSinkMessageExtensions
Inherited Members

Methods

DispatchWhen<TMessage>(IMessageSinkMessage, MessageHandler<TMessage>?)

Handles a message of a specific type by testing it for the type, as well as verifying that there is a registered callback.

public static bool DispatchWhen<TMessage>(this IMessageSinkMessage message, MessageHandler<TMessage>? callback) where TMessage : IMessageSinkMessage

Parameters

message IMessageSinkMessage

The message to dispatch.

callback MessageHandler<TMessage>

The callback to dispatch the message to.

Returns

bool

Returns true if processing should continue; false otherwise.

Type Parameters

TMessage

ToTestCaseDiscovered(ITestCase)

Converts an instance of ITestCase into ITestCaseDiscovered for reporting back to a remote meta-runner.

public static ITestCaseDiscovered ToTestCaseDiscovered(this ITestCase testCase)

Parameters

testCase ITestCase

Returns

ITestCaseDiscovered

WithSourceInfo(ITestCaseDiscovered, string?, int?)

Creates a new ITestCaseDiscovered, replacing the source file and line number information with the provided values.

public static ITestCaseDiscovered WithSourceInfo(this ITestCaseDiscovered discovered, string? sourceFilePath, int? sourceLineNumber)

Parameters

discovered ITestCaseDiscovered
sourceFilePath string

The source file

sourceLineNumber int?

The line number

Returns

ITestCaseDiscovered