Class InlineDataAttribute
- Namespace
- Xunit
- Assembly
- xunit.v3.core.dll
Provides a data source for a data theory, with the data coming from inline values.
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
public sealed class InlineDataAttribute : DataAttribute, IDataAttribute
- Inheritance
-
InlineDataAttribute
- Implements
- Inherited Members
Constructors
InlineDataAttribute(params object?[]?)
Provides a data source for a data theory, with the data coming from inline values.
public InlineDataAttribute(params object?[]? data)
Parameters
dataobject[]The data values to pass to the theory.
Properties
Data
Gets the data to be passed to the test.
public object?[] Data { get; }
Property Value
- object[]
Methods
GetData(MethodInfo, DisposalTracker)
Returns the data to be used to test the theory.
public override ValueTask<IReadOnlyCollection<ITheoryDataRow>> GetData(MethodInfo testMethod, DisposalTracker disposalTracker)
Parameters
testMethodMethodInfoThe test method the data attribute is attached to
disposalTrackerDisposalTrackerThe disposal tracker used to dispose the data
Returns
SupportsDiscoveryEnumeration()
Returns true if the data attribute supports enumeration during
discovery; false otherwise. Data attributes with expensive computational
costs and/or randomized data sets should return false.
public override bool SupportsDiscoveryEnumeration()