CompositeDate.java | Class | Simple domain object class to be used for demonstrating
Data Driven Tests.
CompositeDate is composed of a year, month and day of year.
The fact that there are many constraints on the allowed
combinations makes for interesting test cases.
Further, operations like increment and decrement on
each of the fields leads to many other boundary
conditions for which to test.
The following are groundrules set by the class:
- A year may be any positive or negative integer
- A month may be any integer between 1 and 12, inclusive
- A day may be any integer between 1 and 31, inclusive
These being preconditions imposed on clients, the class
does not check, for instance,
for days greater than 31, or months greater than 12.
Of course, not all combinations of year, month and day
that satisfy these preconditions are valid. |