Try fast search NHibernate

07 August 2009

SharpTestsEx Alpha1: MsTests Extensions

#TestsEx is a set of extensible extensions to work with MsTests. The main target is write short assertions where the Visual Studio intellisense is your guide.

The story

In the lasts two days I remembered why I’m not using MsTests. When I began working with VisualStudio, was using the Express edition that does not have the MsTests suite. One of my customer wants use MsTests because “it is fully integrated and I don’t need to buy/use something else”. When I tried to create a simple test only to try MsTests… surprise surprise I have discovered the state of the art; Oh my God!! Pretty good front end, pretty good runner, very few Attributes to define tests, a not understandable UnitTest generator and, even worst, a very small set of assertions. Ok… I know, I’m an addict of NUnitEx but MsTests seems to stay at the same state of some jurassic NUnit version… Critic without a solution ?


Before start a new framework, I began a little proof of concept to understand which are the extensions point of MsTests and… (again) surprise surprise MsTests is a monolithic piece of code no OO : static classes with implementation in static methods and few utilities classes declared internal… again… Oh my God!! perhaps, in Microsoft, some team should talk with some other team.

Manos a la obra

The first step was create a real easy extensible Assertion. Easy extensible… perhaps it should not need to be inherited

public Assertion(string predicate, TE expected, Func<TA, bool> match,
Func<MessageBuilderInfo<TA, TE>, string> messageBuilder)

After that was only a matter of write code.

The state of the art

Even if this is the first alpha the project is ready to be used. It need some improvement about Failure Messages and, over all, your ideas.

The #TestsEx project is here. Download.

Happy testing, even in MsTests, with SharpTestsEx32x32White #TestsEx

No comments:

Post a Comment