* Tests for dropMultiple.
*/
@Test
public void testDropMultiple() {
// create client UI
final MockClientUI clientUI = new MockClientUI();
// create client
new MockStendhalClient() {
@Override
public void send(final RPAction action) {
client = null;
assertEquals("drop", action.get("type"));
assertEquals(USER_ID, action.getInt("baseobject"));
assertEquals(0, action.getInt("x"));
assertEquals(0, action.getInt("y"));
assertEquals("bag", action.get("baseslot"));
assertEquals(50, action.getInt("quantity"));
assertEquals(MONEY_ID, action.getInt("baseitem"));
}
};
// create a player and give him some money
final RPObject player = createPlayer();
player.getSlot("bag").addPreservingId(createItem("money", MONEY_ID, 100));
// issue "/drop 50 money"
final DropAction action = new DropAction();
assertTrue(action.execute(new String[]{"50"}, "money"));
assertEquals("", clientUI.getEventBuffer());
}