* Tests for onUsed.
*/
@Test
public void testOnUsed() {
FishSourceTestHelper.generateRPClasses();
final FishSource fs = new FishSource("somefish");
final Player player = PlayerTestHelper.createPlayer("bob");
fs.onUsed(player);
assertEquals("You need a fishing rod for fishing.",
player.events().get(0).get("text"));
player.clearEvents();
final StackableItem fishingRod = new StackableItem("fishing rod", "", "",
null);
fishingRod.setQuantity(1);
fishingRod.setID(new ID(2, "testzone"));
player.getSlot("bag").add(fishingRod);
assertTrue(player.isEquipped("fishing rod"));
fs.onUsed(player);
assertEquals("You have started fishing.", player.events().get(0).get("text"));
player.clearEvents();
fs.onUsed(player);
assertFalse(player.has("private_text"));
final Player player2 = PlayerTestHelper.createPlayer("bob");
player2.getSlot("bag").add(fishingRod);
fs.onUsed(player2);
assertEquals("You have started fishing.", player2.events().get(0).get("text"));
}