Table of Contents

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

ctxt TContext

The context that describes the current test class

testMethod TTestMethod

The test method that contains the test cases. May be null for test cases that do not support classes and methods.

testCases IReadOnlyCollection<TTestCase>

The test cases to be failed.

constructorArguments object[]

The constructor arguments that would have been used to create the test class.

exception Exception

The 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.