Class DataAttribute
Abstract attribute which represents a data source for a data theory. Data source providers derive from this attribute and implement GetData to return the data for the theory. Caution: the property is completely enumerated by .ToList() before any test is run. Hence it should return independent object sets.
Namespace: Xunit.Sdk
Assembly: xunit.core.dll
Syntax
public abstract class DataAttribute : Attribute
Properties
| Improve this Doc View SourceSkip
Marks all test cases generated by this data source as skipped.
Declaration
public virtual string Skip { get; set; }
Property Value
Type | Description |
---|---|
String |
Methods
| Improve this Doc View SourceGetData(MethodInfo)
Returns the data to be used to test the theory.
Declaration
public abstract IEnumerable<object[]> GetData(MethodInfo testMethod)
Parameters
Type | Name | Description |
---|---|---|
MethodInfo | testMethod | The method that is being tested |
Returns
Type | Description |
---|---|
IEnumerable<Object[]> | One or more sets of theory data. Each invocation of the test method is represented by a single object array. |