Esempio n. 1
0
 @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());
 }
Esempio n. 2
0
 @Test
 public void locationOfUnknownItemIsNull() {
   Item item = getRegularItem();
   ItemLocation loc = inventory.getLocationOf(item);
   assertNull(loc);
 }
Esempio n. 3
0
 @Test
 public void locationOfNonItemThingIsNull() {
   TestableCreature creature = new TestableCreature(1, "1");
   ItemLocation loc = inventory.getLocationOf(creature);
   assertNull(loc);
 }