Testing an instance method
To test an instance method, you have to create an instance of the class so that the method can be called. Further, it might be necessary to create more instances of the class.
We see this in the image below. In class Time to the left is function IsBefore, which is to be tested. In class TimeTester to the right is procedure testIsBefore. Three different objects of class Time are created and stored in local variables. Then, five assertEquals calls are used to test various function calls. Based on the structure of the return expression in function IsBefore, at least these three calls are needed to give good test coverage.
There is absolutely no need to test that the constructor does the right thing in the three new-expressions in procedure testIsBefore because the constructor has already been tested in procedure testConstructor1.