@Test public void providesSlotLocation() { Item item = getRegularItem(); inventory.executeAddItem(InventorySlot.HEAD, item); ItemLocation loc = inventory.getSlotLocation(InventorySlot.HEAD); assertNotNull(loc); assertSame(item, loc.get()); }
@Test public void locationOfItemFindsItem() { Item item = getRegularItem(); inventory.executeAddItem(InventorySlot.HEAD, item); ItemLocation loc = inventory.getLocationOf(item); assertNotNull(loc); assertSame(item, loc.get()); assertEquals(InventorySlot.HEAD.ordinal(), loc.getIndex()); assertSame(inventory, loc.getCylinder()); }