Table of Contents

Class DelegatingMessageSink<TFinalMessage>

Namespace
Xunit.v3
Assembly
xunit.v3.core.dll

Implementation of IMessageSink that delegates to another implementation of IMessageSink while calling into an optional callback for each message. In addition, it issues a Finished event when a message of the type TFinalMessage is seen and records the final message for later retrieval.

public class DelegatingMessageSink<TFinalMessage> : DelegatingMessageSink, IMessageSink where TFinalMessage : IMessageSinkMessage

Type Parameters

TFinalMessage

The type of the T final message.

Inheritance
DelegatingMessageSink<TFinalMessage>
Implements
Inherited Members

Constructors

DelegatingMessageSink(IMessageSink, Action<IMessageSinkMessage>?)

Implementation of IMessageSink that delegates to another implementation of IMessageSink while calling into an optional callback for each message. In addition, it issues a Finished event when a message of the type TFinalMessage is seen and records the final message for later retrieval.

public DelegatingMessageSink(IMessageSink innerSink, Action<IMessageSinkMessage>? callback = null)

Parameters

innerSink IMessageSink

The inner message sink.

callback Action<IMessageSinkMessage>

The callback.

Properties

FinalMessage

The final message that was seen that caused Finished to be triggered.

public TFinalMessage FinalMessage { get; }

Property Value

TFinalMessage

Finished

An event that is triggered when a message of type TFinalMessage is seen.

public ManualResetEvent Finished { get; }

Property Value

ManualResetEvent

Methods

OnMessage(IMessageSinkMessage)

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

public override 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.