Table of Contents

Interface IDataAttribute

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

Base interface that all data attributes (that is, data providers for theories) are expected to implement. Data attributes are valid on methods only.

public interface IDataAttribute

Properties

Explicit

Gets a value that determines whether the data rows provided by this data provider should be considered explicit or not. If true, then the data rows will all be considered explicit; if false, then the data rows will all be considered not explicit; if null, then the data rows will inherit their explicitness from Explicit.

Skip

Gets a skip reason for all the data rows provided by this data provider. If not null, then all rows will be skipped with the given reason; if null, then the rows will inherit their skip reason from Skip.

TestDisplayName

Gets the test display name for the test (replacing the default behavior, which would be to use DisplayName, or falling back to generating display names based on TestMethodDisplay and TestMethodDisplayOptions).

Timeout

Gets a value to determine if the data rows provided by this data provider should include a timeout (in milliseconds). If greater than zero, the data rows will have the given timeout; if zero or less, the data rows will not have a timeout; if null, the data rows will inherit their timeout from Timeout.

Traits

Gets a set of traits for the associated data. The data is provided as an array of string values that are alternating keys and values (e.g., ["key1", "value1", "key2", "value2"]).

Methods

GetData(MethodInfo, DisposalTracker)

Returns the data to be used to test the theory.

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.