Executed features | Passed | Failures | Errors | Skipped | Success rate | Time |
---|---|---|---|---|---|---|
1 | 1 | 0 | 0 | 0 | 100.0% | 0.004 seconds |
Work Zone
demo test showing how to set the cost of work
should correctly calculate the surface and cost of work
Return
(0.002 seconds)
|
|||||||||
Given:
|
a task to create a blind area for the house
|
||||||||
def foundation = Surface.square(60) def houseWithBlindArea = Surface.square(60 + 2) def blindAreaSurface = houseWithBlindArea - foundation |
|||||||||
And:
|
formula for calculating the rent for a concrete mixer
|
||||||||
PriceFunction concreteMixer = { surface -> 10 + surface.area() * 2 } |
|||||||||
And:
|
formulas for counting materials and work
|
||||||||
PriceFunction concrete = MaterialPrice.of(3) PriceFunction work = WorkPrice.of(5) |
|||||||||
And:
|
the total cost of creating a blind area for a house
|
||||||||
PriceFunction zonePrice = ZonePrice.of(concreteMixer, concrete, work) |
|||||||||
When:
|
we determine the scope of work
|
||||||||
def zone = new Zone(zonePrice, blindAreaSurface) |
|||||||||
Then:
|
we get the exact area
|
||||||||
zone.area() == expectedArea |
|||||||||
And:
|
we get the exact cost of all work
|
||||||||
zone.bill() == expectedBill |
|||||||||
Examples:
|
|
1/1 passed
|