Category Archives: Test

Unittest NServiceBus saga

NServiceBus has it’s own unit test support framework. The nuget package is NServiceBus.Testing. Below I’ll demonstrate how to use it with an example saga from the book Learning NServiceBus. VerifyUserEmailPolicy Saga The saga is used to verify an e-mail address … Continue reading

Posted in Test | Tagged , , | Leave a comment

Art of unit testing

I want to share a basic principle about unit testing I’ve adopted from Roy. Make unit tests:

  • Readable
  • Trustworthy
  • Fast
  • Maintainable

Continue reading

Posted in Test | Tagged , , , | 1 Comment

System.DateTime isolation

After System.Random Isolation I now want to isolate System.DateTime. The information in the struct is not very interesting, but the Now property is. That is a static property. Does that require a different approach? Hardly. IDateTime First I’ll define the … Continue reading

Posted in Test | Tagged , , , , , , , | Leave a comment

System.Random isolation

Writing a unit test is all about isolating the code under test. The best way to do this is by using interfaces. An interface only described the methods and properties, but lets you change the implementation as long as you … Continue reading

Posted in Test | Tagged , , , , , , | 6 Comments

Behavior Driven Development with SpecFlow

Wouldn’t it be great if analysts, testers and developers spoke the same language? When I develop something great the tester says it is wrong and the analyst says it is not what he meant. With SpecFlow the analyst can write … Continue reading

Posted in Test | Tagged , , , | 1 Comment