Koen about .Net

July 14, 2009

Custom assertions in unittests

Filed under: Development — Tags: , — koenwillemse @ 15:00

One of my collegues has been creating a project with custom assertions to be used in unit tests. The idea behind this is that those assertions make your unittests more readable. You get a notation like something.Should().NotBeNull("woops") instead of Assert.IsNotNull(something, "woops").

At first I was not really impressed with it and didn’t see much improvement in it, but that was because I only saw a few small examples. We’re using it also in our unittests and I must say that it makes it more readable, so check out this blog post that he made about it:
http://blog.avivasolutions.nl/archive/2009/06/27/custom-assertions-make-your-tests-more-readable.aspx

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: