Table of Contents

Class ExecutionSink

Namespace
Xunit.Runner.Common
Assembly
xunit.v3.runner.common.dll

This is the execution sink which most runners will use, which can perform several operations (including recording XML results, detecting long running tests, failing skipped tests, failing tests with warnings, and converting the top-level discovery and execution messages into their runner counterparts).

public class ExecutionSink : IMessageSink, IDisposable
Inheritance
ExecutionSink
Implements
Inherited Members

Constructors

ExecutionSink(XunitProjectAssembly, ITestFrameworkDiscoveryOptions, ITestFrameworkExecutionOptions, AppDomainOption, bool, IMessageSink, ExecutionSinkOptions)

Initializes a new instance of the ExecutionSink class.

public ExecutionSink(XunitProjectAssembly assembly, ITestFrameworkDiscoveryOptions discoveryOptions, ITestFrameworkExecutionOptions executionOptions, AppDomainOption appDomainOption, bool shadowCopy, IMessageSink innerSink, ExecutionSinkOptions options)

Parameters

assembly XunitProjectAssembly

The assembly under test.

discoveryOptions ITestFrameworkDiscoveryOptions

The options used during test discovery.

executionOptions ITestFrameworkExecutionOptions

The options used during test execution.

appDomainOption AppDomainOption

A flag to indicate whether app domains are in use.

shadowCopy bool

A flag to indicate whether shadow copying is in use.

innerSink IMessageSink

The inner sink to forward messages to (typically the reporter message handler, retrieved by calling CreateMessageHandler(IRunnerLogger, IMessageSink?) on the runner reporter)

options ExecutionSinkOptions

The options to use for the execution sink

Properties

ExecutionSummary

public ExecutionSummary ExecutionSummary { get; }

Property Value

ExecutionSummary

Finished

public ManualResetEvent Finished { get; }

Property Value

ManualResetEvent

UtcNow

Returns the current time in UTC. Overrideable for testing purposes.

protected virtual DateTimeOffset UtcNow { get; }

Property Value

DateTimeOffset

Methods

Dispose()

public virtual void Dispose()

OnMessage(IMessageSinkMessage)

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

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

WaitForStopEvent(int)

Performs a Task-safe delay. Overrideable for testing purposes.

protected virtual bool WaitForStopEvent(int millionsecondsDelay)

Parameters

millionsecondsDelay int

Returns

bool