Examples of FishSource


Examples of games.stendhal.server.entity.mapstuff.useable.FishSource

   * 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"));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.