Provides a column of random Decimal values as a data source.

Namespace:  MbUnit.Framework
Assembly:  MbUnit (in MbUnit.dll) Version: 3.2.0.0 (3.2.371.0)

Syntax

C#
public class RandomNumbersAttribute : GenerationDataAttribute
Visual Basic (Declaration)
Public Class RandomNumbersAttribute _
	Inherits GenerationDataAttribute

Remarks

Initialize the random number generator by setting the 3 named parameters Minimum, Maximum, and Count according to the desired number of values, and to the expected range of numbers.

Examples

CopyC#
[TestFixture]
public class MyTestFixture
{
    [Test]
    public void MyTestMethod([RandomNumbers(Minimum = 0, Maximum = 10, Count = 3)] decimal value)
    {
        // This test will run 3 times. It generates at each iteration
        // a decimal number between 0 and 10.
    }
}

Inheritance Hierarchy

See Also