Table of Contents

Class TestDiscoverySink

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

An implementation of IMessageSink designed for test discovery for a single test assembly. The Finished event is triggered when discovery is complete.

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

Constructors

TestDiscoverySink(Func<bool>?)

Initializes a new instance of the TestDiscoverySink class.

public TestDiscoverySink(Func<bool>? cancelThunk = null)

Parameters

cancelThunk Func<bool>

An optional thunk which can be used to control cancellation.

Properties

DiscoverySink

Gets the event sink used to record discovery messages.

protected DiscoveryEventSink DiscoverySink { get; }

Property Value

DiscoveryEventSink

Finished

Gets an event which is signaled once discovery is finished.

public ManualResetEvent Finished { get; }

Property Value

ManualResetEvent

TestCases

The list of discovered test cases.

public List<ITestCaseDiscovered> TestCases { get; }

Property Value

List<ITestCaseDiscovered>

Methods

Dispose()

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