Report for lv.id.jc.worker.PerformanceTest


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.033 seconds
The worker performance
allows us to determine the required number of days to process a particular surface

Features:

should accurately calculate days to process surface Return
(0.001 seconds)
Given:
surface that needs to be treated by the worker
surface.area() >> areaToProcess
When:
we create performance object based on the number of surfaces a worker can process in one day
def performance = Performance.of(amountPerDay as double)
Then:
we can accurately calculate the required number of days to process the entire required surface
performance.daysToProcess(surface) == expectedDays
Examples:
amountPerDay areaToProcess expectedDays
1 3 3 OK (0.001 seconds)
1 2.01 3 OK (0)
1 2.99 3 OK (0)
1 3.01 4 OK (0)
0.1 0.3 3 OK (0)
0.001 0.0 0 OK (0)
6/6 passed
should throw an exception for a negative number or zero Return
(0)
When:
''
def performance = Performance.of(amountPerDay as double)
Then:
def message = thrown IllegalArgumentException
And:
message =~ "must be a positive"
Examples:
amountPerDay
-7 OK (0)
0 OK (0)
-0.001 OK (0)
-4.9E-324 OK (0)
4/4 passed