Table of Contents

Class DelegatingMessageBus<TFinalMessage>

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

Implementation of IMessageBus that delegates to another implementation of IMessageBus 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 DelegatingMessageBus<TFinalMessage> : DelegatingMessageBus, IMessageBus, IDisposable where TFinalMessage : IMessageSinkMessage

Type Parameters

TFinalMessage

The type of the T final message.

Inheritance
DelegatingMessageBus<TFinalMessage>
Implements
Inherited Members

Constructors

DelegatingMessageBus(IMessageBus, Action<IMessageSinkMessage>?)

Implementation of IMessageBus that delegates to another implementation of IMessageBus 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 DelegatingMessageBus(IMessageBus innerMessageBus, Action<IMessageSinkMessage>? callback = null)

Parameters

innerMessageBus IMessageBus

The message bus to delegate to.

callback Action<IMessageSinkMessage>

The callback to send messages to.

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

QueueMessage(IMessageSinkMessage)

Queues a message to be sent to the runner.

public override bool QueueMessage(IMessageSinkMessage message)

Parameters

message IMessageSinkMessage

The message to be sent to the runner

Returns

bool

Returns true if discovery/execution should continue; false, otherwise. The return value may be safely ignored by components which are not directly responsible for discovery or execution, and this is intended to communicate to those sub-systems that that they should short circuit and stop their work as quickly as is reasonable.