Class AutoDataAttribute

Namespace: AutoFixture.Xunit3
Assembly: AutoFixture.Xunit3.dll

Provides auto-generated data specimens generated by AutoFixture as an extension to xUnit.net's Theory attribute.

[AttributeUsage(AttributeTargets.Method)]
[CLSCompliant(false)]
public class AutoDataAttribute : DataAttribute

Inheritance

DataAttribute ← AutoDataAttribute

Constructors

AutoDataAttribute()

Initializes a new instance of the AutoDataAttribute class.

public AutoDataAttribute()

Remarks

This constructor overload initializes the `Fixture` to an instance of `Fixture`.

AutoDataAttribute(Func<IFixture>)

Initializes a new instance of the AutoDataAttribute class with the supplied fixtureFactory. Fixture will be created on demand using the provided factory.

protected AutoDataAttribute(Func<IFixture> fixtureFactory)

Parameters

fixtureFactory Func<IFixture>

The fixture factory used to construct the fixture.

Properties

FixtureFactory

Gets the fixture factory.

public Func<IFixture> FixtureFactory { get; }

Property Value

Func<IFixture>

Methods

GetData(MethodInfo, DisposalTracker)

public override ValueTask<IReadOnlyCollection<ITheoryDataRow>> GetData(MethodInfo testMethod, DisposalTracker disposalTracker)

Parameters

testMethod MethodInfo

disposalTracker DisposalTracker

Returns

ValueTask<IReadOnlyCollection<ITheoryDataRow>>

SupportsDiscoveryEnumeration()

public override bool SupportsDiscoveryEnumeration()

Returns

bool