Table of Contents

Method DispatchWhen

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

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

The message to dispatch.

callback

The callback to dispatch the message to.

Returns

bool

Returns true if processing should continue; false otherwise.

Type Parameters

TMessage