* Tests for getSlotNameToEquip.
*/
@Test
public void testGetSlotNameToEquip() {
final RPEntity baglessentity = new MockRPentity();
final Item item = createMock(Item.class);
final List<String> slotnames = Arrays.asList("bag");
expect(item.getPossibleSlots()).andReturn(slotnames);
replay(item);
assertEquals(null, baglessentity.getSlotNameToEquip(item));
verify(item);
reset(item);
final RPEntity entityWithBag = new MockRPentity() {
@Override
public boolean hasSlot(final String arg0) {
return true;
}
@Override
public RPSlot getSlot(final String arg0) {
return new RPSlot();
}
};
expect(item.getPossibleSlots()).andReturn(slotnames);
replay(item);
assertEquals("bag", entityWithBag.getSlotNameToEquip(item));
verify(item);
reset(item);
final RPEntity entityWithFullBag = new MockRPentity() {
@Override
public boolean hasSlot(final String arg0) {
return true;
}
@Override
public RPSlot getSlot(final String arg0) {
return new RPSlot() {
@Override
public boolean isFull() {
return true;
}
};
}
};
expect(item.getPossibleSlots()).andReturn(slotnames);
replay(item);
assertEquals(null, entityWithFullBag.getSlotNameToEquip(item));
verify(item);
}