* Tests for dropSomeOfItem.
*/
@Test
public void testDropSomeOfItem() {
final Player player = PlayerTestHelper.createPlayer("bob");
StendhalRPZone localzone = new StendhalRPZone("testzone", 20, 20);
StackableItem item = (StackableItem) SingletonRepository.getEntityManager().getItem("cheese");
item.setQuantity(5);
player.equip("bag", item);
assertTrue(player.isEquipped("cheese", 5));
localzone.add(player);
final RPAction drop = new RPAction();
drop.put("type", "drop");
drop.put("baseobject", player.getID().getObjectID());
drop.put("baseslot", "bag");
drop.put("x", player.getX());
drop.put("y", player.getY() + 1);
drop.put("quantity", "2");
drop.put("baseitem", item.getID().getObjectID());
final EquipmentAction action = new DropAction();
assertEquals(0, localzone.getItemsOnGround().size());
assertTrue(drop.has(EquipActionConsts.BASE_ITEM));
action.onAction(player, drop);
Assert.assertEquals(0, player.events().size());
assertEquals(1, localzone.getItemsOnGround().size());
assertFalse(player.isEquipped("cheese", 4));
assertTrue(player.isEquipped("cheese", 3));
}