Class TestClassRunner<TContext, TTestClass, TTestMethod, TTestCase>
- Namespace
- Xunit.v3
- Assembly
- xunit.v3.core.dll
A base class that provides default behavior when running tests in a test class. It groups the tests by test method, and then runs the individual test methods.
public abstract class TestClassRunner<TContext, TTestClass, TTestMethod, TTestCase> where TContext : TestClassRunnerContext<TTestClass, TTestCase> where TTestClass : class, ITestClass where TTestMethod : class, ITestMethod where TTestCase : class, ITestCase
Type Parameters
TContextThe context type used by the runner
TTestClassThe type of the test class used by the test framework. Must derive from ITestClass.
TTestMethodThe type of the test method used by the test framework. Must derive from ITestMethod.
TTestCaseThe type of the test case used by the test framework. Must derive from ITestCase.
- Inheritance
-
TestClassRunner<TContext, TTestClass, TTestMethod, TTestCase>
- Derived
- Inherited Members
Constructors
- TestClassRunner()
Initializes a new instance of the TestClassRunner<TContext, TTestClass, TTestMethod, TTestCase> class.
Methods
- CreateTestClassConstructorArguments(TContext)
Creates the arguments for the test class constructor. By default just returns an empty set of arguments. Override to find the arguments for the constructor.
- FailTestMethod(TContext, TTestMethod?, IReadOnlyCollection<TTestCase>, object?[], Exception)
Fails the tests from a test method due to an exception.
- OnTestClassCleanupFailure(TContext, Exception)
This method is called when an exception was thrown while cleaning up, after the test class has run. By default, this sends TestClassCleanupFailure.
- OnTestClassFinished(TContext, RunSummary)
This method will be called when the test class has finished running. By default, this sends TestClassFinished. Override this to enable any extensibility related to test class finish.
- OnTestClassStarting(TContext)
This method will be called before the test class has started running. By default, this sends TestClassStarting. Override this to enable any extensibility related to test class start.
- OrderTestCases(TContext)
Orders the test cases in the class. By default does not re-order the test cases. Override this to provide custom test case ordering.
- Run(TContext)
Runs the tests in the test class.
- RunTestMethod(TContext, TTestMethod?, IReadOnlyCollection<TTestCase>, object?[])
Override this method to run the tests in an individual test method.
- RunTestMethods(TContext, Exception?)
Runs the list of test methods. By default, orders the tests, groups them by method and runs them synchronously.
- SetTestContext(TContext, TestEngineStatus)
Sets the current TestContext for the current test class and the given test class status.