Kirk Evans Blog

.NET From a Markup Perspective

Great article on nUnit and Test First Development

Rather than simply presenting nUnit, this article goes out of its way to illustrate the concepts behind test-driven development.  The basic premise:

  1. Write a test.
  2. Run the test. It fails to compile because the code you’re trying to test doesn’t even exist yet! (This is the same thing as failing.)
  3. Write a bare-bones stub to make the test compile.
  4. Run the test. It should fail. (If it doesn’t, then the test wasn’t very good.)
  5. Implement the code to make the test pass.
  6. Run the test. It should pass. (If it doesn’t, back up one step and try again.)
  7. Start over with a new test!

It also highlights using Mock Objects… a very good read.