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

#Every

Matches if all elements in a collection do:

    [Test]
    public void Every()
    {
        var containsA = Contains.String("a");
        var hasAs = new Every(containsA);
        var collection = new [] { "aaa", "bba", "cca" };

        Assert.That(collection, hasAs);
        // or alternatively
        Assert.That(collection, Every.Item(Contains.String("a")));
    }
Clone this wiki locally