Category Archives: Test

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

Visual Studio Load Test with fiddler

In Visual Studio you add a new Web Performance Test and Internet Explorer opens with the plugin to record the traffic. But what if you want to use another client that not lives in the browser like a Desktop App? … Continue reading

Posted in Test | Tagged , , , , , , | 1 Comment

Test async webservice call with a Task

We have a number of services in our project. Our clients include WPF, iOS, Android and Web. To have the best interoperability we communicate over http and expose WSDL for proxy generation. This means we cannot change the contracts or … Continue reading

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

Implement Interface as virtual methods

A best pratice in Object Oriented Programming is the use of Interfaces. When applied correctly it simplifies unit testing. But watch out for the pitfall of default implementation by Visual Studio. Below is an example how this can bite you. … Continue reading

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