Report for lv.id.jc.FundValuationAcceptanceTest


Summary:

Created on Tue Oct 25 14:34:32 UTC 2022 by runner
Executed features Passed Failures Errors Skipped Success rate Time
13 13 0 0 0 100.0% 0.149 seconds
Project Customer evaluates the balance of funds
As the customer of the project 
I want to estimate the balance of available funds
So that I be able to adjust the estimate if necessary
Issues:

Features:

should calculate zero balance when no assignments Return
(0.003 seconds)
When:
we have no assignments
def fundValuation = FundValuation.of()
Then:
we get zero fund balance
fundValuation.fundBalance() == 0
should calculate balance when one senior worker with one wall assignment Return
(0.009 seconds)
Given:
one senior worker
def painter = new SeniorWorker(Payment.of(rate), Performance.of(amountPerDay))
And:
one zone with a rectangle surface and some apertures
def surface = Surface.rectangle(width, height)
def zone = zoneFactory.create(type, surface - apertures)
And:
one assignment with one zone for that worker
def assigment = painter.assign(zone, VendorBonus.of(bonus))
When:
we create a fund valuation with this assignment
def fundValuation = FundValuation.of(assigment)
Then:
we can accurate calculate fund balance
fundValuation.fundBalance() == expected
Where:
surface sides, zone type, vendor bonus and worker characteristics
Examples:
width height type apertures bonus rate amountPerDay expected assignment
5 5 Wall lv.id.jc.workscope.Surface$$Lambda$609/0x0000000800f66488@78d49939 50 250 30 250 one wall assignment OK (0.009 seconds)
should calculate balance when one senior worker with one wall assignment with big vendor bonus Return
(0)
Given:
one senior worker
def painter = new SeniorWorker(Payment.of(rate), Performance.of(amountPerDay))
And:
one zone with a rectangle surface and some apertures
def surface = Surface.rectangle(width, height)
def zone = zoneFactory.create(type, surface - apertures)
And:
one assignment with one zone for that worker
def assigment = painter.assign(zone, VendorBonus.of(bonus))
When:
we create a fund valuation with this assignment
def fundValuation = FundValuation.of(assigment)
Then:
we can accurate calculate fund balance
fundValuation.fundBalance() == expected
Where:
surface sides, zone type, vendor bonus and worker characteristics
Examples:
width height type apertures bonus rate amountPerDay expected assignment
5 5 Wall lv.id.jc.workscope.Surface$$Lambda$609/0x0000000800f66488@78d49939 100 250 30 175 one wall assignment with big vendor bonus OK (0)
should calculate balance when one senior worker with one big wall with aperture assignment Return
(0)
Given:
one senior worker
def painter = new SeniorWorker(Payment.of(rate), Performance.of(amountPerDay))
And:
one zone with a rectangle surface and some apertures
def surface = Surface.rectangle(width, height)
def zone = zoneFactory.create(type, surface - apertures)
And:
one assignment with one zone for that worker
def assigment = painter.assign(zone, VendorBonus.of(bonus))
When:
we create a fund valuation with this assignment
def fundValuation = FundValuation.of(assigment)
Then:
we can accurate calculate fund balance
fundValuation.fundBalance() == expected
Where:
surface sides, zone type, vendor bonus and worker characteristics
Examples:
width height type apertures bonus rate amountPerDay expected assignment
10 10 Wall lv.id.jc.workscope.Surface$$Lambda$611/0x0000000800f66910@3e242137 50 250 30 100 one big wall with aperture assignment OK (0)
should calculate balance when one senior worker with one floor assignment Return
(0)
Given:
one senior worker
def painter = new SeniorWorker(Payment.of(rate), Performance.of(amountPerDay))
And:
one zone with a rectangle surface and some apertures
def surface = Surface.rectangle(width, height)
def zone = zoneFactory.create(type, surface - apertures)
And:
one assignment with one zone for that worker
def assigment = painter.assign(zone, VendorBonus.of(bonus))
When:
we create a fund valuation with this assignment
def fundValuation = FundValuation.of(assigment)
Then:
we can accurate calculate fund balance
fundValuation.fundBalance() == expected
Where:
surface sides, zone type, vendor bonus and worker characteristics
Examples:
width height type apertures bonus rate amountPerDay expected assignment
5 5 Floor lv.id.jc.workscope.Surface$$Lambda$609/0x0000000800f66488@78d49939 50 180 30 209 one floor assignment OK (0)
should calculate balance when one senior worker with one ceiling assignment Return
(0)
Given:
one senior worker
def painter = new SeniorWorker(Payment.of(rate), Performance.of(amountPerDay))
And:
one zone with a rectangle surface and some apertures
def surface = Surface.rectangle(width, height)
def zone = zoneFactory.create(type, surface - apertures)
And:
one assignment with one zone for that worker
def assigment = painter.assign(zone, VendorBonus.of(bonus))
When:
we create a fund valuation with this assignment
def fundValuation = FundValuation.of(assigment)
Then:
we can accurate calculate fund balance
fundValuation.fundBalance() == expected
Where:
surface sides, zone type, vendor bonus and worker characteristics
Examples:
width height type apertures bonus rate amountPerDay expected assignment
5 5 Ceiling lv.id.jc.workscope.Surface$$Lambda$609/0x0000000800f66488@78d49939 50 200 30 235 one ceiling assignment OK (0)
should calculate balance when one senior worker with one small ceiling assignment Return
(0)
Given:
one senior worker
def painter = new SeniorWorker(Payment.of(rate), Performance.of(amountPerDay))
And:
one zone with a rectangle surface and some apertures
def surface = Surface.rectangle(width, height)
def zone = zoneFactory.create(type, surface - apertures)
And:
one assignment with one zone for that worker
def assigment = painter.assign(zone, VendorBonus.of(bonus))
When:
we create a fund valuation with this assignment
def fundValuation = FundValuation.of(assigment)
Then:
we can accurate calculate fund balance
fundValuation.fundBalance() == expected
Where:
surface sides, zone type, vendor bonus and worker characteristics
Examples:
width height type apertures bonus rate amountPerDay expected assignment
3 5 Ceiling lv.id.jc.workscope.Surface$$Lambda$609/0x0000000800f66488@78d49939 50 200 30 15 one small ceiling assignment OK (0)
should calculate balance when one worker with two ceiling assignment Return
(0.007 seconds)
Given:
one senior worker
def painter = new SeniorWorker(Payment.of(200), Performance.of(30))
And:
two ceiling assignment
def zone1 = zoneFactory.create("Ceiling", Surface.rectangle(2, 5))
def zone2 = zoneFactory.create("Ceiling", Surface.rectangle(3, 5))
def assigment = new Assignment(painter, Zones.of(zone1, zone2), VendorBonus.of(50))
When:
we create a fund valuation with this assignment
def fundValuation = FundValuation.of(assigment)
And:
calculate balance
def balance = fundValuation.fundBalance()
Then:
we get expected fund balance
balance == 235
should calculate balance when one junior worker with one ceiling assignment and #comment Return
(0.001 seconds)
Given:
one junior worker
def junior = new JuniorWorker(Payment.of(200), Performance.of(30))
And:
one ceiling assignment
def zone = zoneFactory.create("Ceiling", Surface.square(5.0))
def assigment = new Assignment(junior, zone, VendorBonus.of(bonus))
When:
we create a fund valuation with this assignment
def fundValuation = FundValuation.of(assigment)
And:
calculate balance
def balance = fundValuation.fundBalance()
Then:
we get expected result
balance == expected
Examples:
bonus expected comment
50 300 regular vendor bonus OK (0.001 seconds)
100 250 big vendor bonus OK (0)
2/2 passed
should calculate balance when one #worker with one ceiling assignment Return
(0)
Given:
one ceiling assignment
def zone = zoneFactory.create("Ceiling", Surface.square(5))
def assigment = new Assignment(painter, Zones.of(zone), VendorBonus.of(50))
When:
we create a fund valuation with this assignment
def fundValuation = FundValuation.of(assigment)
And:
calculate balance
def balance = fundValuation.fundBalance()
Then:
we get expected result
balance == expected
Where:
worker defined as
Examples:
painter expected worker
lv.id.jc.worker.JuniorWorker@55da6bf 400 junior cheap worker OK (0)
lv.id.jc.worker.SeniorWorker@3a0f5141 259 senior cheap worker OK (0)
2/2 passed
should calculate balance when one worker with one wall assignment #comment Return
(0.002 seconds)
Given:
one senior worker
def senior = new SeniorWorker(Payment.of(250), Performance.of(amountPerDay))
And:
one wall assignment
def workScope = zoneFactory.create("Wall", surface)
def assigment = senior.assign(workScope, VendorBonus.of(50))
When:
we create a work estimate with this assignment
def fundValuation = FundValuation.of(assigment)
Then:
we get expected fund balance
fundValuation.fundBalance() == expected
Examples:
surface amountPerDay expected comment
lv.id.jc.workscope.Surface$$Lambda$610/0x0000000800f666c8@2898c70d 30 450 works two days but less amount then max per day OK (0)
lv.id.jc.workscope.Surface$$Lambda$610/0x0000000800f666c8@ec67be1 30 782.5 works two days and more amount then max per day OK (0.001 seconds)
lv.id.jc.workscope.Surface$$Lambda$610/0x0000000800f666c8@64a00fe0 60 1082.5 works one day but more amount then max per day OK (0.001 seconds)
3/3 passed
should calculate balance when two workers with one wall assignment Return
(0.002 seconds)
Given:
two senior workers
def highDailyRate = Payment.of(250)
def ordinaryPerformance = Performance.of(30)
def john = new SeniorWorker(highDailyRate, ordinaryPerformance)
def mike = new SeniorWorker(highDailyRate, ordinaryPerformance)
And:
one wall zone
def zone = zoneFactory.create("Wall", Surface.square(5))
And:
two wall assignments
def johnAssigment = new Assignment(john, zone, VENDOR_BONUS)
def mikeAssigment = new Assignment(mike, zone, VENDOR_BONUS)
When:
we create a fund valuation with this assignments
def fundValuation = FundValuation.of(johnAssigment, mikeAssigment)
And:
calculate balance
def balance = fundValuation.fundBalance()
Then:
we get expected result
balance == 500
should calculate balance for complex testcase Return
(0.003 seconds)
Given:
several workers
def liam = new SeniorWorker(Payment.of(250), Performance.of(40))
def jack = new JuniorWorker(Payment.of(200), Performance.of(30))
def owen = new SeniorWorker(Payment.of(280), Performance.of(60))
And:
def apertures = Surface.rectangle(9, 5).plus(Surface.rectangle(9, 4))
And:
def zone1 = zoneFactory.create("Floor", Surface.rectangle(5, 3))
def zone2 = zoneFactory.create("Wall", Surface.square(10))
def zone3 = zoneFactory.create("Ceiling", Surface.square(5))
def zone4 = zoneFactory.create("Wall", Surface.square(10) - apertures)
def zone5 = zoneFactory.create("Wall", Surface.rectangle(1, 5))
def zone6 = zoneFactory.create("Wall", Surface.rectangle(11, 5))
And:
def liamAssigment = liam.assign(Zones.of(zone1, zone2), BIG_VENDOR_BONUS)
def jackAssigment = jack.assign(Zones.of(zone3, zone4), VENDOR_BONUS)
def owenAssigment = owen.assign(Zones.of(zone5, zone6), VENDOR_BONUS)
When:
we create a fund valuation with this assignments
def fundValuation = FundValuation.of(liamAssigment, jackAssigment, jackAssigment, owenAssigment)
And:
calculate balance
def actual = fundValuation.fundBalance()
Then:
we get expected result
actual == expected
Where:
expected fund balance
Examples:
expected
4221.5 OK (0.003 seconds)
1/1 passed