xUnit.net
Public Member Functions | Properties | List of all members
Xunit.Sdk.DataAttribute Class Referenceabstract

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. More...

Inheritance diagram for Xunit.Sdk.DataAttribute:
Xunit.ClassDataAttribute Xunit.InlineDataAttribute Xunit.MemberDataAttributeBase Xunit.MemberDataAttribute

Public Member Functions

abstract IEnumerable< object[]> GetData (MethodInfo testMethod)
 Returns the data to be used to test the theory. More...
 

Properties

virtual string Skip [get, set]
 Marks all test cases generated by this data source as skipped. More...
 

Detailed Description

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.

Member Function Documentation

◆ GetData()

abstract IEnumerable<object[]> Xunit.Sdk.DataAttribute.GetData ( MethodInfo  testMethod)
pure virtual

Returns the data to be used to test the theory.

Parameters
testMethodThe method that is being tested
Returns
One or more sets of theory data. Each invocation of the test method is represented by a single object array.

Implemented in Xunit.MemberDataAttributeBase, Xunit.ClassDataAttribute, and Xunit.InlineDataAttribute.

Property Documentation

◆ Skip

virtual string Xunit.Sdk.DataAttribute.Skip
getset

Marks all test cases generated by this data source as skipped.


The documentation for this class was generated from the following file: