Table of Contents

Method SetTestContext

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

SetTestContext(TContext, TestEngineStatus, TestResultState?, object?)

Sets the test context for the given test state and engine status.

protected virtual void SetTestContext(TContext ctxt, TestEngineStatus testStatus, TestResultState? testState = null, object? testClassInstance = null)

Parameters

ctxt TContext

The context that describes the current test

testStatus

The current engine status for the test

testState

The current test state

testClassInstance object

The instance of the test class

Remarks

This method must never throw. Behavior is undefined if it does. Instead, exceptions that occur should be recorded in the aggregator in ctxt and will be reflected in a way that's appropriate based on when this method is called.