Project Description
SharpTestsEx (Sharp Tests Extensions) is a set of extensible extensions. The main target is write short assertions where the Visual Studio IDE intellisense is your guide. #TestsEx can be used with NUnit, MsTests, xUnit, MbUnit... even in Silverlight.

Have a look to the Syntax Overview.

The Origin
The origin of SharpTestsEx is my dear NUnitEx. The motivation of its born is described in this old post and the original repository is still available on Google Code Archive.

Strongly typed Assertions few examples
true.Should().Be.True();
false.Should().Be.False();

const string something = "something";
something.Should().Contain("some");
something.Should().Not.Contain("also");
something.ToUpperInvariant().Should().Not.Contain("some");

something.Should()
    .StartWith("so")
    .And
    .EndWith("ing")
    .And
    .Contain("meth");

something.Should()
    .Not.StartWith("ing")
    .And
    .Not.EndWith("so")
    .And
    .Not.Contain("body");

var ints = new[] { 1, 2, 3 };
ints.Should().Have.SameSequenceAs(new[] { 1, 2, 3 });
ints.Should().Not.Have.SameSequenceAs(new[] { 3, 2, 1 });
ints.Should().Not.Be.Null();
ints.Should().Not.Be.Empty();

ints.Should()
    .Contain(2)
    .And
    .Not.Contain(4);

(new int[0]).Should().Be.Empty();

Blog posts of the author

Last edited Nov 14 at 2:25 PM by fabiomaulo, version 10