ValueSourceAttribute Class

Summary

Indicates the source used to provide data for one parameter of a test method.
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["ValueSourceAttribute"] class Type type-node

Syntax

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

Attributes

Type Description
AttributeUsageAttribute

Constructors

Name Summary
ValueSourceAttribute(string) Construct with the name of the factory - for use with languages that don't support params arrays.
ValueSourceAttribute(Type, string) Construct with a Type and name - for use with languages that don't support params arrays.

Properties

Name Value Summary
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
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
Retrieves a list of arguments which can be passed to the specified parameter.
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