Migrating Existing Tests to ApprovalTests

This is a short article to describe how I migrated a bunch of existing verbose tests to ApprovalTests. All of the examples in this article are based on my Shameless Green in C# library, which will be familiar to reader’s of 99 Bottles of OOP. Here are some quick links you might want once youContinue reading “Migrating Existing Tests to ApprovalTests”

Test-Driven Development and Duplication

I have run a good number of test-driven development coding dojos (and behaviour-driven development ones), and participated in plenty of them too. The most common errors I have found can be classified as: Trying to find abstractions too early Drastic code changes under the banner of “refactoring” Both of these problems are solved by practisingContinue reading “Test-Driven Development and Duplication”

Using an In Memory Database as a Test Double with Entity Framework

If you are using Entity Framework and you want to test your application without the real database, the typical technique employed is to write a repository or query provider that you can substitute with a stub during the test. Sometimes, though, you are better off pushing things a couple of levels deeper. This is whereContinue reading “Using an In Memory Database as a Test Double with Entity Framework”