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

#StringStartsWith

Matches if a string starts with another string:

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

        Assert.That(actual, startsWithThe);
        // or alternatively
        Assert.That(actual, Starts.With("the"));
    }
Clone this wiki locally