Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Sometimes two or more pieces of code play very nicely together. This is great—until you want to test them in isolation. While it's good to write testable code, you shouldn't have to go through contortions to make it possible to write tests. Sometimes it's okay for your tests to poke through the abstractions, just a little bit, to make sure that your code works the way you think it ought to work.
Being a little bit tricky in your test code—in the proper places and with the proper precautions—can make both your code and your tests much simpler and easier to test.