Table of Contents

Method OnTestStarting

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

OnTestStarting(TContext)

This method is called just before the test is run. By default, this sends TestStarting. Override this to enable any extensibility related to test start.

protected override ValueTask<bool> OnTestStarting(TContext ctxt)

Parameters

ctxt TContext

The context that describes the current test

Returns

ValueTask<bool>

Return true if test execution should continue; false if it should be shut down.

Remarks

This method runs during Initializing and any exceptions thrown will contribute to test failure (and will prevent the test from running). Even if this method records exceptions, OnTestFinished(TContext, decimal, string, string[]?, IReadOnlyDictionary<string, TestAttachment>?) will be called.