Method GetFixture
- Namespace
- Xunit
- Assembly
- xunit.v3.core.aot.dll
GetFixture(Type)
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).
ValueTask<object?> GetFixture(Type fixtureType)
Parameters
fixtureTypeTypeThe exact type of the fixture
Returns
Remarks
This may be a fixture attached via IClassFixture<TFixture>, ICollectionFixture<TFixture>, or AssemblyFixtureAttribute.
GetFixture<T>()
Gets a fixture that was attached to the test class. Will return default if there is no exact match for the requested fixture type, or if there is no test class (that is, if TestClass returns null).
ValueTask<T?> GetFixture<T>()
Returns
Type Parameters
TThe exact type of the fixture
Remarks
This may be a fixture attached via IClassFixture<TFixture>, ICollectionFixture<TFixture>, or AssemblyFixtureAttribute.