CS 222 Programming Studio, Spring 2018
TDD Lab Practice
- Your task in this practice is to write test cases for a
Clock
class. The code
exists in the public repository.
- A
Clock
object represents the daily time.
- Take a look at the methods declared in the given
Clock
class.
For each method, write test cases in the given (and currently empty)
ClockTest
class in the test
package.
- Carefully design your test cases to cover corner cases.
Clock
’s constructor should throw IllegalArgumentException
if the hour, minutes, or the seconds parameters are not proper values.
(E.g. 79 is illegal for seconds, 30 is illegal for the hour.)