Table of Contents

Class RandomAttribute

Namespace
NUnit.Framework
Assembly
nunit.framework.dll

Supplies a set of random values to a single parameter of a parameterized test.

[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
public class RandomAttribute : NUnitAttribute, IParameterDataSource
Inheritance
RandomAttribute
Implements
Inherited Members

Constructors

RandomAttribute(byte, byte, int)

Generates byte values within a specified range.

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

Parameters

min byte
max byte
count int

RandomAttribute(double, double, int)

Generates double values within a specified range.

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

Parameters

min double
max double
count int

RandomAttribute(short, short, int)

Generates short values 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)

Generates int values within a specified range.

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

Parameters

min int
max int
count int

RandomAttribute(long, long, int)

Generates long values within a specified range.

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

Parameters

min long
max long
count int

RandomAttribute(sbyte, sbyte, int)

Generates sbyte values 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)

Generates float values within a specified range.

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

Parameters

min float
max float
count int

RandomAttribute(ushort, ushort, int)

Generates ushort values 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)

Generates uint values 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)

Generates ulong values within a specified range.

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

Parameters

min ulong
max ulong
count int

Properties

Distinct

If true, no value will be repeated.

public bool Distinct { get; set; }

Property Value

bool

Methods

GetData(IParameterInfo)

Retrieves a list of arguments which can be passed to the specified parameter.

public IEnumerable GetData(IParameterInfo parameter)

Parameters

parameter IParameterInfo

The parameter of a parameterized test.

Returns

IEnumerable