June 2017
Beginner to intermediate
274 pages
6h 49m
English
I mentioned in passing that all the unit tests in a TestCase class should share the same operating environment. What does that mean?
It means that each of them expects any external data that they access to be in the same state. For example, each of the tests accesses a particular file and each of them expects to find the same information inside that file.
Let's have a look at a code example:

In the preceding example, we have two tests that both read and write in the same text file. Both of them expected to come in to contain the same specific information when they started running. ...
Read now
Unlock full access