Table of Contents

Class FixtureMappingManager

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

Maps fixture objects, including support for generic collection fixtures.

public class FixtureMappingManager : IAsyncDisposable
Inheritance
FixtureMappingManager
Implements
Inherited Members

Remarks

Initializes a new instance of the FixtureMappingManager class.

Constructors

FixtureMappingManager(string, object[])

FOR TESTING PURPOSES ONLY.

protected FixtureMappingManager(string fixtureCategory, object[] cachedFixtureValues)

Parameters

fixtureCategory string
cachedFixtureValues object[]

FixtureMappingManager(string, FixtureMappingManager?)

Maps fixture objects, including support for generic collection fixtures.

public FixtureMappingManager(string fixtureCategory, FixtureMappingManager? parentMappingManager = null)

Parameters

fixtureCategory string

The category of fixture (i.e., "Assembly"); used in exception messages

parentMappingManager FixtureMappingManager

The parent mapping manager (used to resolve constructor arguments)

Remarks

Initializes a new instance of the FixtureMappingManager class.

Properties

GlobalFixtureTypes

Returns a list of all known fixture types at all category levels.

public IReadOnlyCollection<Type> GlobalFixtureTypes { get; }

Property Value

IReadOnlyCollection<Type>

LocalFixtureTypes

Returns a list of the known fixture types at this category level. This will not include fixture types known from parent categories and above.

public IReadOnlyCollection<Type> LocalFixtureTypes { get; }

Property Value

IReadOnlyCollection<Type>

Methods

DisposeAsync()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.

public ValueTask DisposeAsync()

Returns

ValueTask

GetFixture(Type)

Get a value for the given fixture type. If the fixture type is unknown, then returns null.

public ValueTask<object?> GetFixture(Type fixtureType)

Parameters

fixtureType Type

The type of the fixture

Returns

ValueTask<object>

Returns the value if the fixture type is found, or null if it's not.

InitializeAsync(IReadOnlyCollection<Type>)

public ValueTask InitializeAsync(IReadOnlyCollection<Type> fixtureTypes)

Parameters

fixtureTypes IReadOnlyCollection<Type>

Returns

ValueTask

InitializeAsync(params Type[])

public ValueTask InitializeAsync(params Type[] fixtureTypes)

Parameters

fixtureTypes Type[]

Returns

ValueTask