Report for lv.id.jc.worker.JuniorWorkerTest


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.043 seconds
Junior Worker
calculation of wages and personal bonus for a junior worker

Features:

should calculate personal bonus for Junior work Return
(0.028 seconds)
Given:
junior worker with any payment and performance parameters
def worker = new JuniorWorker(_ as Payment, _ as Performance)
Expect:
personal bonus is equals to vendor bonus
worker.personalBonus(vendorBonus) == personalBonus
Examples:
vendorBonus personalBonus
0.0 0 OK (0.028 seconds)
55.55 55.55 OK (0)
100.0 100 OK (0)
3/3 passed
should calculate salary for Junior worker Return
(0.001 seconds)
Given:
daily rate and worker productivity
def payment = Payment.of(dailyRate)
def performance = Performance.of(amountPerDay)
And:
junior worker with given payment and performance parameters
def worker = new JuniorWorker(payment, performance)
When:
we have a surface to be treated
def surface = Stub(Surface) { area() >> surfaceArea }
Then:
we get accurate calculated wages of this worker for a given surface
worker.salary(surface) == juniorSalary
Examples:
dailyRate amountPerDay surfaceArea juniorSalary
120.0 20.0 100 600 OK (0.001 seconds)
109.5 21.3 287 1533 OK (0)
2/2 passed