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

#IsSame

Matches if two objects are the same (reference equals):

    [Test]
    public void IsSame()
    {
        var firstBiscuit = new Biscuit("Garibaldi");
        var secondBiscuit = firstBiscuit;
        var isSameAsFirstBiscuit = new IsSame(firstBiscuit);

        Assert.That(secondBiscuit, isSameAsFirstBiscuit);
        // or alternatively
        Assert.That(secondBiscuit, Is.SameAs(secondBiscuit));
    }
Clone this wiki locally