Skip to content
grahamrhay edited this page Nov 9, 2010 · 1 revision

#AllOf

Matches if all of its sub-matchers do:

    [Test]
    public void AllOf()
    {
        var containsCat = Contains.String("cat");
        var containsMat = Contains.String("mat");
        var matchesAllOf = new AllOf(new[] { containsCat, containsMat });
        const string actual = "the cat sat on the mat";

        Assert.That(actual, matchesAllOf);
        // or alternatively
        Assert.That(actual, Matches.AllOf(containsCat, containsMat));
    }
Clone this wiki locally