Interface ITestAssemblyRunner
The ITestAssemblyRunner interface is implemented by classes that are able to execute a suite of tests loaded from an assembly.
public interface ITestAssemblyRunner
Properties
IsTestComplete
Indicates whether a test run is complete
bool IsTestComplete { get; }
Property Value
IsTestLoaded
Indicates whether a test has been loaded
bool IsTestLoaded { get; }
Property Value
IsTestRunning
Indicates whether a test is currently running
bool IsTestRunning { get; }
Property Value
LoadedTest
Gets the tree of loaded tests, or null if no tests have been loaded.
ITest? LoadedTest { get; }
Property Value
Result
Gets the tree of test results, if the test run is completed, otherwise null.
ITestResult? Result { get; }
Property Value
Methods
CountTestCases(ITestFilter)
Count Test Cases using a filter
int CountTestCases(ITestFilter filter)
Parameters
filter
ITestFilterThe filter to apply
Returns
- int
The number of test cases found
ExploreTests(ITestFilter)
Explore the test cases using a filter
ITest ExploreTests(ITestFilter filter)
Parameters
filter
ITestFilterThe filter to apply
Returns
- ITest
Test Assembly with test cases that matches the filter
Load(Assembly, IDictionary<string, object>)
Loads the tests found in an Assembly, returning an indication of whether or not the load succeeded.
ITest Load(Assembly assembly, IDictionary<string, object> settings)
Parameters
assembly
AssemblyThe assembly to load
settings
IDictionary<string, object>Dictionary of options to use in loading the test
Returns
- ITest
An ITest representing the loaded tests
Load(string, IDictionary<string, object>)
Loads the tests found in an Assembly, returning an indication of whether or not the load succeeded.
ITest Load(string assemblyName, IDictionary<string, object> settings)
Parameters
assemblyName
stringFile name of the assembly to load
settings
IDictionary<string, object>Dictionary of options to use in loading the test
Returns
- ITest
An ITest representing the loaded tests
Run(ITestListener, ITestFilter)
Run selected tests and return a test result. The test is run synchronously, and the listener interface is notified as it progresses.
ITestResult Run(ITestListener listener, ITestFilter filter)
Parameters
listener
ITestListenerInterface to receive ITestListener notifications.
filter
ITestFilterA test filter used to select tests to be run
Returns
RunAsync(ITestListener, ITestFilter)
Run selected tests asynchronously, notifying the listener interface as it progresses.
void RunAsync(ITestListener listener, ITestFilter filter)
Parameters
listener
ITestListenerInterface to receive EventListener notifications.
filter
ITestFilterA test filter used to select tests to be run
StopRun(bool)
Signal any test run that is in process to stop. Return without error if no test is running.
void StopRun(bool force)
Parameters
force
boolIf true, kill any test-running threads
WaitForCompletion(int)
Wait for the ongoing run to complete.
bool WaitForCompletion(int timeout)
Parameters
timeout
intTime to wait in milliseconds
Returns
- bool
True if the run completed, otherwise false