Table of Contents

Method GetFixture

Namespace
Xunit
Assembly
xunit.v3.core.dll

GetFixture<TFixture>(ITestContext)

Gets a fixture that was attached to the test class. Will return null if there is no exact match for the requested fixture type, or if there is no test class (that is, if TestClass returns null).

public static ValueTask<TFixture?> GetFixture<TFixture>(this ITestContext ctxt)

Parameters

ctxt

Returns

ValueTask<TFixture>

The fixture, if available; null, otherwise

Type Parameters

TFixture

The exact type of the fixture

Remarks