Skip to content
aochsner edited this page May 21, 2012 · 2 revisions

#AnyOf

Matches if any of its sub-matchers do:

    [Test]
    public void AnyOf()
    {
        var containsCat = Contains.String("cat");
        var containsJohn = Contains.String("john");
        var matchesAnyOf = new AnyOf(new[] { containsCat, containsJohn });
        const string actual = "the cat sat on the mat";

        Assert.That(actual, matchesAnyOf);
        // or alternatively
        Assert.That(actual, Matches.AnyOf(containsCat, containsJohn));
    }
Clone this wiki locally