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