Table of Contents

Method FailTestClass

Namespace
Xunit.v3
Assembly
xunit.v3.core.dll

FailTestClass(TContext, TTestClass?, IReadOnlyCollection<TTestCase>, Exception)

Fails the tests from a test class due to an exception.

protected virtual ValueTask<RunSummary> FailTestClass(TContext ctxt, TTestClass? testClass, IReadOnlyCollection<TTestCase> testCases, Exception exception)

Parameters

ctxt TContext

The context that describes the current test collection

testClass TTestClass

The test class that is being failed. May be null for test cases that do not support classes and methods.

testCases IReadOnlyCollection<TTestCase>

The test cases to be failed.

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.