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 the type String, 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([RandomStrings(Count = 3, Pattern = @"[A-Z]{5,8}", Filter = "MyFilter")]] string text)
    {
        // Code logic here...
    }

    public static bool MyFilter(string text)
    {
        return text != "AAAAA";
    }
}

See Also