Using Moq to Implement Tests (and Avoid Stubs)

February 25th, 2009 § 4 comments § permalink

In my previous post on understanding TDD I discussed how to analyze existing code for creating unit tests.  This was somewhat of “reverse TDD”, the idea being to look for what to needs to be tested- the relationship between what one class expects and what another class actually does.  Unfortunately I stopped short of actually implementing those tests- which is the subject of this post.

Read More

Understand Unit Testing and TDD: Getting Better Code Coverage

December 18th, 2008 § 3 comments § permalink

One of the biggest challenges in unleashing the power of unit testing is getting good code coverage.  Most of the time, especially when teams are just starting out with Test Driven Development, unit testing usually gets in the way.  A lot of people (I succumb to this syndrome sometimes) add tests after they develop code.  The audacity! Some people just don’t unit test at all- especially when struggling with mocking a dependency, like a database or the HttpContext object.  And forget about finding more than one unit test for functions- you already have one for a function which passes- so you’re done, right?

Read More

Where Am I?

You are currently browsing entries tagged with TDD at Adventures in HttpContext.