Report for lv.id.jc.worker.AbstractWorkerTest


Summary:

Created on Tue Oct 25 14:34:32 UTC 2022 by runner
Executed features Passed Failures Errors Skipped Success rate Time
1 1 0 0 0 100.0% 0.008 seconds
Abstract Worker
base class for workers that implements standard payroll calculations

Features:

should calculate salary Return
(0.004 seconds)
Given:
stubbed surface returns predefined area
surface.area() >> processingArea
And:
we create an implementation of the abstract worker class
def worker = new AbstractWorker(payment, performance) {
    @Override
    BigDecimal personalBonus(BigDecimal vendorBonus) {
        return null
    }
}
When:
we calculate the salary of a worker for processing a given surface
def salary = worker.salary(surface)
Then:
a method is called to calculate the required number of days
1 * performance.daysToProcess(surface) >> workingDays
And:
a method is called to calculate the amount of salary for the number of days worked
1 * payment.payForDays(workingDays) >> payForWork
And:
the calculated salary value is returned as a result
salary == payForWork
Examples:
processingArea workingDays payForWork
100 4 400 OK (0.004 seconds)
1/1 passed