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

#StringContains

Matches if a string contains another string:

    [Test]
    public void StringContains()
    {
        var containsCat = new StringContains("cat");
        const string actual = "the cat sat on the mat";

        Assert.That(actual, containsCat);
        // or alternatively
        Assert.That(actual, Contains.String("cat"));
    }
Clone this wiki locally