Class ExecutionSink
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
assemblyXunitProjectAssemblyThe assembly under test.
discoveryOptionsITestFrameworkDiscoveryOptionsThe options used during test discovery.
executionOptionsITestFrameworkExecutionOptionsThe options used during test execution.
appDomainOptionAppDomainOptionA flag to indicate whether app domains are in use.
shadowCopyboolA flag to indicate whether shadow copying is in use.
innerSinkIMessageSinkThe inner sink to forward messages to (typically the reporter message handler, retrieved by calling CreateMessageHandler(IRunnerLogger, IMessageSink?) on the runner reporter)
optionsExecutionSinkOptionsThe options to use for the execution sink
Properties
ExecutionSummary
public ExecutionSummary ExecutionSummary { get; }
Property Value
Finished
public ManualResetEvent Finished { get; }
Property Value
UtcNow
Returns the current time in UTC. Overrideable for testing purposes.
protected virtual DateTimeOffset UtcNow { get; }
Property Value
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
messageIMessageSinkMessageThe message from the message bus
Returns
- bool
Return
trueto continue running tests, orfalseto stop.
WaitForStopEvent(int)
Performs a Task-safe delay. Overrideable for testing purposes.
protected virtual bool WaitForStopEvent(int millionsecondsDelay)
Parameters
millionsecondsDelayint