Table of Contents

Class XunitFrontController

Namespace
Xunit
Assembly
xunit.v3.runner.utility.netfx.dll

Default implementation of IFrontController which supports running tests from xUnit.net v1, v2, and v3.

public class XunitFrontController : IFrontController, IFrontControllerDiscoverer, IAsyncDisposable
Inheritance
XunitFrontController
Implements
Inherited Members

Properties

CanUseAppDomains

Gets a flag indicating whether this discovery/execution can use app domains.

public bool CanUseAppDomains { get; }

Property Value

bool

TargetFramework

Gets the target framework that the test assembly is linked against.

public string TargetFramework { get; }

Property Value

string

TestAssemblyUniqueID

Gets the unique ID for the test assembly provided to the discoverer.

public string TestAssemblyUniqueID { get; }

Property Value

string

TestFrameworkDisplayName

Returns the display name of the test framework that this discoverer is running tests for.

public string TestFrameworkDisplayName { get; }

Property Value

string

Methods

Create(XunitProjectAssembly, ISourceInformationProvider?, IMessageSink?, ITestProcessLauncher?)

Returns an implementation of IFrontController which can be used for both discovery and execution. If the assembly does not appear to be a test assembly, returns null.

public static IFrontController? Create(XunitProjectAssembly projectAssembly, ISourceInformationProvider? sourceInformationProvider = null, IMessageSink? diagnosticMessageSink = null, ITestProcessLauncher? testProcessLauncher = null)

Parameters

projectAssembly XunitProjectAssembly

The test project assembly.

sourceInformationProvider ISourceInformationProvider

The optional source information provider.

diagnosticMessageSink IMessageSink

The optional message sink which receives IDiagnosticMessage and IInternalDiagnosticMessage messages.

testProcessLauncher ITestProcessLauncher

The test process launcher, used to launch v3 test processes. If not provided, LocalOutOfProcessTestProcessLauncher will be used. (This value is not used when running v1 or v2 test proceses.)

Returns

IFrontController

DisposeAsync()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.

public ValueTask DisposeAsync()

Returns

ValueTask

Find(IMessageSink, FrontControllerFindSettings)

Starts the process of finding tests in an assembly. Typically only used by runners which discover tests and present them into a UI for the user to interactively choose for selective run (via Run(IMessageSink, FrontControllerRunSettings)). For runners which simply wish to discover and immediately run tests, they should instead use FindAndRun(IMessageSink, FrontControllerFindAndRunSettings), which permits the same filtering logic as this method.

public virtual void Find(IMessageSink messageSink, FrontControllerFindSettings settings)

Parameters

messageSink IMessageSink

The message sink to report results back to.

settings FrontControllerFindSettings

The settings used during discovery.

FindAndRun(IMessageSink, FrontControllerFindAndRunSettings)

Starts the process of finding and running tests in an assembly. Typically only used by runner which do not present test discovery UIs to users that allow them to run selected tests (those should instead use Find(IMessageSink, FrontControllerFindSettings) and Run(IMessageSink, FrontControllerRunSettings) as separate operations).

public void FindAndRun(IMessageSink messageSink, FrontControllerFindAndRunSettings settings)

Parameters

messageSink IMessageSink

The message sink to report results back to.

settings FrontControllerFindAndRunSettings

The settings used during discovery and execution.

Run(IMessageSink, FrontControllerRunSettings)

Starts the process of running selected tests in the assembly. The serialized test cases to run come from calling Find(IMessageSink, FrontControllerFindSettings).

public void Run(IMessageSink messageSink, FrontControllerRunSettings settings)

Parameters

messageSink IMessageSink

The message sink to report results back to.

settings FrontControllerRunSettings

The settings used during execution.