TestCaseDataAttribute Class

Summary

TestCaseDataAttribute indicates the source to be used to provide test cases for a test method. That source may be any static field, property or method in the current fixture or any other class.
Namespace
TCLite
Interfaces
Base Types
graph BT Type-->Base0["TCLiteAttribute"] click Base0 "/tc-lite/api/TCLite/TCLiteAttribute" Base0-->Base1["Attribute"] Base1-->Base2["object"] Type-.->Interface0["ITestCaseFactory"] click Interface0 "/tc-lite/api/TCLite.Interfaces/ITestCaseFactory" Type-.->Interface1["IImplyFixture"] click Interface1 "/tc-lite/api/TCLite.Interfaces/IImplyFixture" Type["TestCaseDataAttribute"] class Type type-node

Syntax

[AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = false)]
public class TestCaseDataAttribute : TCLiteAttribute, ITestCaseFactory, IImplyFixture

Attributes

Type Description
AttributeUsageAttribute

Constructors

Name Summary
TestCaseDataAttribute(string) Construct with the name of the static method, property or field that will provide data
TestCaseDataAttribute(Type, string) Construct with a Type and name

Properties

Name Value Summary
Category string
Gets or sets the category or categories to be associated with all tests generated by this attribute. May be a single category or a comma-separated list.
Description string
Gets or sets the description to be used for all tests generated by this attribute.
SourceName string
The name of a the method, property or field to be used as a source
SourceType Type
A Type to be used as a source

Methods

Name Value Summary
GetTestCasesFor(MethodInfo) IEnumerable<ITestCaseData>
Returns a set of ITestCaseDataItems for use as arguments to a parameterized test method.