ValuesAttribute Class

Summary

ValuesAttribute is used to provide literal arguments for an individual parameter of a test.
Namespace
TCLite
Interfaces
Base Types
graph BT Type-->Base0["DataParamAttribute"] click Base0 "/tc-lite/api/TCLite/DataParamAttribute" Base0-->Base1["TCLiteAttribute"] click Base1 "/tc-lite/api/TCLite/TCLiteAttribute" Base1-->Base2["Attribute"] Base2-->Base3["object"] Type-.->Interface0["IParameterDataSource"] click Interface0 "/tc-lite/api/TCLite.Interfaces/IParameterDataSource" Type["ValuesAttribute"] class Type type-node

Syntax

[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
public class ValuesAttribute : DataParamAttribute, IParameterDataSource

Attributes

Type Description
AttributeUsageAttribute

Constructors

Name Summary
ValuesAttribute(object[]) Construct with an array of arguments

Fields

Name Constant Value Summary
_dataValues
The collection of data to be returned. Must be set by any derived attribute classes. We use an object[] so that the individual elements may have their type changed in GetData if necessary

Methods

Name Value Summary
Convert(object, Type) object
Converts a single value to the targetType, if it is supported.
Inherited from DataParamAttribute
static
ConvertData(object[], Type) IEnumerable
Converts an array of objects to the targetType, if it is supported.
Inherited from DataParamAttribute
static
GetData(ParameterInfo) IEnumerable
Get the collection of values to be used as arguments
TryConvert(object, Type, object) bool
Performs several special conversions allowed by NUnit in order to permit arguments with types that cannot be used in the constructor of an Attribute such as TestCaseAttribute or to simplify their use.
Inherited from DataParamAttribute
static