Table of Contents

Class RandomAttribute

Namespace
NUnit.Framework
Assembly
nunit.framework.dll

RandomAttribute is used to supply a set of random _values to a single parameter of a parameterized test.

public class RandomAttribute : DataAttribute, IParameterDataSource
Inheritance
RandomAttribute
Implements
Inherited Members

Constructors

RandomAttribute(byte, byte, int)

Construct a set of bytes within a specified range

public RandomAttribute(byte min, byte max, int count)

Parameters

min byte
max byte
count int

RandomAttribute(double, double, int)

Construct a set of doubles within a specified range

public RandomAttribute(double min, double max, int count)

Parameters

min double
max double
count int

RandomAttribute(short, short, int)

Construct a set of shorts within a specified range

public RandomAttribute(short min, short max, int count)

Parameters

min short
max short
count int

RandomAttribute(int)

Construct a random set of values appropriate for the Type of the parameter on which the attribute appears, specifying only the count.

public RandomAttribute(int count)

Parameters

count int

RandomAttribute(int, int, int)

Construct a set of ints within a specified range

public RandomAttribute(int min, int max, int count)

Parameters

min int
max int
count int

RandomAttribute(long, long, int)

Construct a set of longs within a specified range

public RandomAttribute(long min, long max, int count)

Parameters

min long
max long
count int

RandomAttribute(sbyte, sbyte, int)

Construct a set of sbytes within a specified range

[CLSCompliant(false)]
public RandomAttribute(sbyte min, sbyte max, int count)

Parameters

min sbyte
max sbyte
count int

RandomAttribute(float, float, int)

Construct a set of floats within a specified range

public RandomAttribute(float min, float max, int count)

Parameters

min float
max float
count int

RandomAttribute(ushort, ushort, int)

Construct a set of unsigned shorts within a specified range

[CLSCompliant(false)]
public RandomAttribute(ushort min, ushort max, int count)

Parameters

min ushort
max ushort
count int

RandomAttribute(uint, uint, int)

Construct a set of unsigned ints within a specified range

[CLSCompliant(false)]
public RandomAttribute(uint min, uint max, int count)

Parameters

min uint
max uint
count int

RandomAttribute(ulong, ulong, int)

Construct a set of unsigned longs within a specified range

[CLSCompliant(false)]
public RandomAttribute(ulong min, ulong max, int count)

Parameters

min ulong
max ulong
count int

Methods

GetData(ParameterInfo)

Get the collection of _values to be used as arguments.

public IEnumerable GetData(ParameterInfo parameter)

Parameters

parameter ParameterInfo

Returns

IEnumerable