Report for lv.id.jc.worker.PaymentTest


Summary:

Created on Tue Oct 25 14:34:32 UTC 2022 by runner
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

Features:

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:
dailyRate workingDays expectedPayment
100 10 1000 OK (0.001 seconds)
100 0 0 OK (0)
0 10 0 OK (0)
0.1 3 0.3 OK (0)
3.3 3 9.9 OK (0)
199.01 3 597.03 OK (0)
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:
dailyRate
-7 OK (0)
-0.001 OK (0)
-4.9E-324 OK (0)
3/3 passed