Method FailTestMethod
- Namespace
- Xunit.v3
- Assembly
- xunit.v3.core.dll
FailTestMethod(TContext, TTestMethod?, IReadOnlyCollection<TTestCase>, object?[], Exception)
Fails the tests from a test method due to an exception.
protected virtual ValueTask<RunSummary> FailTestMethod(TContext ctxt, TTestMethod? testMethod, IReadOnlyCollection<TTestCase> testCases, object?[] constructorArguments, Exception exception)
Parameters
ctxtTContextThe context that describes the current test class
testMethodTTestMethodThe test method that contains the test cases. May be
nullfor test cases that do not support classes and methods.testCasesIReadOnlyCollection<TTestCase>The test cases to be failed.
constructorArgumentsobject[]The constructor arguments that would have been used to create the test class.
exceptionExceptionThe exception that was caused during startup.
Returns
- ValueTask<RunSummary>
Returns summary information about the tests that were failed.
Remarks
By default, using XunitRunnerHelper to fail the test cases.