Summary
We used TDD throughout this chapter to add Hamcrest confirmations and even improve the existing code for classical confirmations. Without TDD, the existing code in a real project would likely not get approval from management to make changes.
This chapter showed you the benefits of having unit tests that can help verify the quality of code after making changes. We were able to refactor the existing classical confirmations design for dealing with strings so that it matches the new design, which has a similar need. This lets both the classical and Hamcrest confirmations share a similar design instead of maintaining two different designs. All the changes were possible because the unit tests verified that everything continued to run as expected.
The most important changes in this chapter added Hamcrest style confirmations, which are more intuitive and more flexible than the classic confirmations developed in Chapter 4, Adding Tests to a Project. Additionally, the new Hamcrest...