@Test public void testUse() { final Character character = mock(Character.class); final Inventory inventory = mock(Inventory.class); when(character.getInventory()).thenReturn(inventory); gold1.use(character); verify(inventory).cleanup(); verify(character).addMoney(1000); }
@Override public void use(Character character) { character.addMoney(amount); amount = 0; character.getInventory().cleanup(); }
Gold extends ConsumableItem { @Override public void use(Character character) { character.addMoney(amount); amount = 0; character.getInventory().cleanup(); } }
Gold extends ConsumableItem { @Override public void use(Character character) { character.addMoney(amount); amount = 0; character.getInventory().cleanup(); } Gold(ItemProperties properties, int amount); }
Gold extends ConsumableItem { @Override public void use(Character character) { character.addMoney(amount); amount = 0; character.getInventory().cleanup(); } Gold(ItemProperties properties, int amount); @Override Item clone(); @Override void use(Character character); }
Gold extends ConsumableItem { @Override public void use(Character character) { character.addMoney(amount); amount = 0; character.getInventory().cleanup(); } Gold(ItemProperties properties, int amount); @Override Item clone(); @Override void use(Character character);  }