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