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
TargetFramework
Gets the target framework that the test assembly is linked against.
public string TargetFramework { get; }
Property Value
TestAssemblyUniqueID
Gets the unique ID for the test assembly provided to the discoverer.
public string TestAssemblyUniqueID { get; }
Property Value
TestFrameworkDisplayName
Returns the display name of the test framework that this discoverer is running tests for.
public string TestFrameworkDisplayName { get; }
Property Value
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
projectAssemblyXunitProjectAssemblyThe test project assembly.
sourceInformationProviderISourceInformationProviderThe optional source information provider.
diagnosticMessageSinkIMessageSinkThe optional message sink which receives IDiagnosticMessage and IInternalDiagnosticMessage messages.
testProcessLauncherITestProcessLauncherThe 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
DisposeAsync()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.
public ValueTask DisposeAsync()
Returns
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
messageSinkIMessageSinkThe message sink to report results back to.
settingsFrontControllerFindSettingsThe 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
messageSinkIMessageSinkThe message sink to report results back to.
settingsFrontControllerFindAndRunSettingsThe 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
messageSinkIMessageSinkThe message sink to report results back to.
settingsFrontControllerRunSettingsThe settings used during execution.