(Item item, int codeNumber)
| 29 | } |
| 30 | |
| 31 | public void addItem(Item item, int codeNumber) throws Exception { |
| 32 | |
| 33 | for (ItemShelf itemShelf : itemShelves) { |
| 34 | if (itemShelf.code == codeNumber) { |
| 35 | if (itemShelf.isSoldOut()) { |
| 36 | itemShelf.item = item; |
| 37 | itemShelf.setSoldOut(false); |
| 38 | } else { |
| 39 | throw new Exception("already item is present, you can not add item here"); |
| 40 | } |
| 41 | } |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | public Item getItem(int codeNumber) throws Exception { |
| 46 |
nothing calls this directly
no test coverage detected