@TestStep(VEND) public void vend() { Item item = machine.random(coins, rand); scripter.step("VEND (" + bottles + ") - " + item.name); test.addCoverage("item", item.name); coins -= item.cost; bottles--; req.covered(VEND); }
@TestStep(C50) public void insert50cents() { scripter.step("50c"); coins += 50; req.covered(C50); }
@TestStep(C20) public void insert20cents() { scripter.step("20c"); coins += 20; req.covered(C20); }
@TestStep(C10) public void insert10cents() { scripter.step("10c"); coins += 10; req.covered(C10); }
public VendingMachine() { req.add(C10); req.add(C20); req.add(C50); req.add(VEND); }