RandomAttribute Class

Summary

Supplies a set of random values to a single parameter of a parameterized 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["RandomAttribute"] class Type type-node

Syntax

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

Attributes

Type Description
AttributeUsageAttribute

Constructors

Name Summary
RandomAttribute(byte, byte, int) Generates System.Byte values within a specified range.
RandomAttribute(double, double, int) Generates double values within a specified range.
RandomAttribute(float, float, int) Generates System.Single values within a specified range.
RandomAttribute(int, int, int) Generates int values within a specified range.
RandomAttribute(int) Construct a random set of values appropriate for the Type of the parameter on which the attribute appears, specifying only the count.
RandomAttribute(long, long, int) Generates long values within a specified range.
RandomAttribute(sbyte, sbyte, int) Generates sbyte values within a specified range.
RandomAttribute(short, short, int) Generates short values within a specified range.
RandomAttribute(uint, uint, int) Generates uint values within a specified range.
RandomAttribute(ulong, ulong, int) Generates ulong values within a specified range.
RandomAttribute(ushort, ushort, int) Generates ushort values within a specified range.

Properties

Name Value Summary
Distinct bool
If true, no value will be repeated.

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