Executed features | Passed | Failures | Errors | Skipped | Success rate | Time |
---|---|---|---|---|---|---|
2 | 2 | 0 | 0 | 0 | 100.0% | 0.023 seconds |
Zone of work
a component test that demonstrates the use of the Zone class
should calculate all expenses per zone for one day work
Return
(0.001 seconds)
|
||||||||||
Given:
|
surface for painting
|
|||||||||
def totalSurface = Surface.square(squareSide) def apertures = Surface.zero() |
||||||||||
And:
|
formulas for calculating the cost of putty and paint
|
|||||||||
def putty = MaterialPrice.of(8) def paint = MaterialPrice.of(7) |
||||||||||
And:
|
formulas for calculating the cost of the relevant work
|
|||||||||
def puttying = WorkPrice.of(10) def painting = WorkPrice.of(15) |
||||||||||
And:
|
formula for total expenses includes all other formulas
|
|||||||||
def expenses = ZonePrice.of(putty, paint, puttying, painting) |
||||||||||
When:
|
we create a work zone with a specific surface and with a given cost
|
|||||||||
def zone = new Zone(expenses, totalSurface, apertures) |
||||||||||
Then:
|
we get a precisely calculated area of work
|
|||||||||
zone.area() == expectedArea |
||||||||||
And:
|
we get a correctly and precisely calculated bill
|
|||||||||
zone.bill() == expectedBill |
||||||||||
Examples:
|
|
|||||||||
should calculate all expenses per zone for multi day work
Return
(0.001 seconds)
|
||||||||||
Given:
|
surface for painting
|
|||||||||
def totalSurface = Surface.square(squareSide) def apertures = Surface.zero() |
||||||||||
And:
|
formulas for calculating the cost of putty and paint
|
|||||||||
def putty = MaterialPrice.of(8) def paint = MaterialPrice.of(7) |
||||||||||
And:
|
formulas for calculating the cost of the relevant work
|
|||||||||
def puttying = WorkPrice.of(10) def painting = WorkPrice.of(15) |
||||||||||
And:
|
formula for total expenses includes all other formulas
|
|||||||||
def expenses = ZonePrice.of(putty, paint, puttying, painting) |
||||||||||
When:
|
we create a work zone with a specific surface and with a given cost
|
|||||||||
def zone = new Zone(expenses, totalSurface, apertures) |
||||||||||
Then:
|
we get a precisely calculated area of work
|
|||||||||
zone.area() == expectedArea |
||||||||||
And:
|
we get a correctly and precisely calculated bill
|
|||||||||
zone.bill() == expectedBill |
||||||||||
Examples:
|
|