Project Description
#TestsEx (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.

Have a look to the Syntax Overview.

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 Jan 13 at 5:11 PM by fabiomaulo, version 9

 

Want to leave feedback?
Please use Discussions or Reviews instead.

Updating...
© 2006-2010 Microsoft | About CodePlex | Privacy Statement | Terms of Use | Code of Conduct | Advertise With Us | Version 2010.1.12.16187