Summary
This chapter completes the minimum functionality needed in a unit testing library. We’re not done developing the testing library, but it now has enough features to be useful to another project.
You learned about the issues involved with adding setup and teardown code and the benefits provided. The primary benefit is that tests can now focus on what is important to be tested. Tests are easier to understand when everything needed to run the test is no longer cluttering the test and the cleanup is handled automatically.
There are two types of setup and teardown. One is local to the test; it can be reused in other tests but local means that the setup runs at the beginning of the test and the teardown happens at the end of the test. Another test that shares the same setup and teardown will repeat the setup and teardown in that other test.
The other type of setup and teardown is actually shared by multiple tests. This is the test suite setup and teardown; its setup...