Test Data Builder Pattern

The test data builder pattern is a way of solving a pretty common problem when creating unit tests. When creating tests, you usually need to create test data to run on your system under test (sut). This can easily become unwieldy, when you need to take nested data into consideration. As you can see, it Read more about Test Data Builder Pattern[…]

Dependency injection in unit tests: Introducing Autofixture

Changing dependencies in your SUT (system under test) usually means that you have to revise all of your previous tests. This is because the default way of instantiating your SUT is newing one up and passing in any mocks it might need. This destroys test and code maintainability. Every time you make a change to Read more about Dependency injection in unit tests: Introducing Autofixture[…]

Mocking dependencies for more maintainable unit tests

Using a mocking framework in your unit tests will make your unit tests much shorter, much easier to comprehend, and much easier to maintain. In short, a good mocking framework is an absolutely must have tool in any developers toolkit. In this article, I will discuss what a mocking framework is and why it is Read more about Mocking dependencies for more maintainable unit tests[…]

Writing Testable Code, an Intro to Unit Testing

The art of writing testable code is not as easy as it seams. There are a lot of things you need to keep in mind just in order to create code that is actually testable. This is something we keep coming back to and probably something you encountered your self. “This code isn’t testable” is Read more about Writing Testable Code, an Intro to Unit Testing[…]