Mocking Dependencies (silly dependency! um... not that kind of mocking)

The code in this post is also available on Github. In a mood at work the other day (after hunting down some obscure bug that would’ve been more apparent, had I had some relevant failing tests to point me in the right direction), I started back-filling old code with unit tests. That meant removing some dependencies on things I didn’t actually need to test, so I’ll post a few (contrived) examples. Don’t Rely on External Dependencies One of the most critical pieces of unit testing (although not overly complicated, as I’ll show) is mocking out »