(String args[])
| 6 | public class Main { |
| 7 | |
| 8 | public static void main(String args[]){ |
| 9 | |
| 10 | VendingMachine vendingMachine = new VendingMachine(); |
| 11 | try { |
| 12 | |
| 13 | System.out.println("|"); |
| 14 | System.out.println("filling up the inventory"); |
| 15 | System.out.println("|"); |
| 16 | |
| 17 | fillUpInventory(vendingMachine); |
| 18 | displayInventory(vendingMachine); |
| 19 | |
| 20 | System.out.println("|"); |
| 21 | System.out.println("clicking on InsertCoinButton"); |
| 22 | System.out.println("|"); |
| 23 | |
| 24 | States vendingState = vendingMachine.getVendingMachineState(); |
| 25 | vendingState.clickOnInsertCoinButton(vendingMachine); |
| 26 | |
| 27 | vendingState = vendingMachine.getVendingMachineState(); |
| 28 | vendingState.insertCoin(vendingMachine, Coin.NICKEL); |
| 29 | vendingState.insertCoin(vendingMachine, Coin.QUARTER); |
| 30 | // vendingState.insertCoin(vendingMachine, Coin.NICKEL); |
| 31 | |
| 32 | System.out.println("|"); |
| 33 | System.out.println("clicking on ProductSelectionButton"); |
| 34 | System.out.println("|"); |
| 35 | vendingState.clickOnStartProductSelectionButton(vendingMachine); |
| 36 | |
| 37 | vendingState = vendingMachine.getVendingMachineState(); |
| 38 | vendingState.chooseProduct(vendingMachine, 102); |
| 39 | |
| 40 | displayInventory(vendingMachine); |
| 41 | |
| 42 | } |
| 43 | catch (Exception e){ |
| 44 | displayInventory(vendingMachine); |
| 45 | } |
| 46 | |
| 47 | |
| 48 | } |
| 49 | |
| 50 | private static void fillUpInventory(VendingMachine vendingMachine){ |
| 51 | Inventory inventory = vendingMachine.getInventory(); |
nothing calls this directly
no test coverage detected