This is a lightweight project that allows programmers to generate Unit tests by annotation of business methods. It allows enrichment of code via Attributes giving a testname, defining a postcondition that will be checked, and parameters to feed to the method.
A motivating article can be found here:
http://whiletrue.nl/blog/?p=93 The approach is somewhat of a hybrid betwee TDD (Test Driven Design) and DbC (Design by Contract). The idea is to get best of both worlds, but work remains to be done.
For Example, this creates an "OldFashionedPersonTest" with a postcondition that checks equality the name to "Boonzaaijer" after invoking the method MarryTo() with a new Person object named Boonzaaijer.
[Test("OldFashionedPersonTest",
"this.Name==\"Boonzaaijer\"",
"new WhileTrue.TestSharp.TestDomain.Person(\"Boonzaaijer\")")]
public void MarryTo(Person toMarryTo)
{
}
This generates the following Unit Test:
[Test]
public void Generated_OldFashionedPersonTest()
{
WhileTrue.TestSharp.TestDomain.Person _this = new WhileTrue.TestSharp.TestDomain.Person();
_this.MarryTo(new WhileTrue.TestSharp.TestDomain.Person("Boonzaaijer"));
Assert.That(_this.Name=="Boonzaaijer");
}