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
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:
|
|
2/2 passed
|