Gets or sets the name of a method present in the test fixture whose purpose is to prevent some specific values to be generated.

Namespace:  MbUnit.Framework
Assembly:  MbUnit (in MbUnit.dll) Version: 3.3.0.0 (3.3.610.0)

Syntax

C#
public string Filter { get; set; }
Visual Basic (Declaration)
Public Property Filter As String

Remarks

The method must accepts one argument of a type that represents a number, such as Decimal, Double, or Int32, and returns a Boolean value indicating whether the specified value must be accepted or rejected.

Examples

CopyC#
[TestFixture]
public class MyTestFixture
{
    [Test]
    public void Generate_filtered_sequence([RandomNumbers(Minimum = 1, Maximum = 100, Count = 50, Filter = "MyFilter")] int value)
    {
        // Code logic here...
    }

    public static bool MyFilter(int number)
    {
        return (n % 3 == 0) || (n % 10 == 0);
    }
}

See Also