Report for lv.id.jc.worker.WorkerFunctionalTest


Summary:

Created on Tue Oct 25 14:34:33 UTC 2022 by runner
Executed features Passed Failures Errors Skipped Success rate Time
1 1 0 0 0 100.0% 0.015 seconds
Workers
the demo test that shows the differences in payroll for different workers

Features:

should calculate the correct salary for workers of different types Return
(0.001 seconds)
Given:
same productivity and pay per day for both types of workers
def payment = Payment.of(250)
def performance = Performance.of(30)
And:
identical working surface for both types of workers
def surface = Surface.square(5)
When:
we create a worker of a certain type
def worker = workerFabric.apply(payment, performance)
Then:
we get salary corresponds to the expected salary for this type
worker.salary(surface) == expectedSalary
When:
we have a bonus from the vendor
def vendorBonus = VendorBonus.of(100)
Then:
we get a personal bonus corresponding to the type of worker
worker.personalBonus(vendorBonus) == expectedBonus
Where:
different types of workers and their corresponding wages
And:
a factory that creates a worker of the desired type with the given parameters
workerFabric = workerType as BiFunction<Payment, Performance, Worker>
Examples:
workerType expectedSalary expectedBonus workerFabric
<executable> 250 100 org.codehaus.groovy.runtime.MethodClosure@dcf64d2 OK (0.001 seconds)
<executable> 300 150 org.codehaus.groovy.runtime.MethodClosure@1e8c741c OK (0)
2/2 passed