Executed features | Passed | Failures | Errors | Skipped | Success rate | Time |
---|---|---|---|---|---|---|
2 | 2 | 0 | 0 | 0 | 100.0% | 0.018 seconds |
Worker's pay
this class is responsible for paying the worker
should accurately calculate the worker's salary for the days worked
Return
(0.001 seconds)
|
|||||||||||||||||||||||||||||
When:
|
we create a payment based on the daily rate of a worker
|
||||||||||||||||||||||||||||
def payment = Payment.of(dailyRate as double) |
|||||||||||||||||||||||||||||
Then:
|
we get the accurately calculated wages of the worker for the days worked
|
||||||||||||||||||||||||||||
payment.payForDays(workingDays) == expectedPayment |
|||||||||||||||||||||||||||||
Examples:
|
|
6/6 passed
|
|||||||||||||||||||||||||||
should throw an exception for a negative number
Return
(0)
|
|||||||||||||||||||||||||||||
When:
|
def payment = Payment.of(dailyRate as double) |
||||||||||||||||||||||||||||
Then:
|
def message = thrown IllegalArgumentException |
||||||||||||||||||||||||||||
And:
|
message =~ "must be a positive" |
||||||||||||||||||||||||||||
Examples:
|
|
3/3 passed
|