Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* $Id$ */
- /***************************************************************************
- * (C) Copyright 2003-2010 - Stendhal *
- ***************************************************************************
- ***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
- package games.stendhal.server.entity.npc;
- import static org.junit.Assert.assertEquals;
- import static org.junit.Assert.assertTrue;
- import static utilities.SpeakerNPCTestHelper.getReply;
- import org.junit.BeforeClass;
- import org.junit.Test;
- import games.stendhal.server.entity.npc.fsm.Engine;
- import utilities.ZonePlayerAndNPCTestImpl;
- /**
- * Test NPC is in the game.
- *
- * @author Bozhidar Nedelchev
- */
- public class NewsGuyNPC extends ZonePlayerAndNPCTestImpl {
- private static final String ZONE_NAME = "0_deniran";
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {
- setupZone(ZONE_NAME);
- }
- public NewsGuyNPC() {
- setNpcNames("Mr News Guy");
- setZoneForPlayer(ZONE_NAME);
- }
- /**
- * Tests for hiAndBye.
- */
- @Test
- public void testHiAndBye() {
- final SpeakerNPC npc = getNPC("Mr News Guy");
- final Engine en = npc.getEngine();
- assertTrue(en.step(player, "hi"));
- assertEquals("Greetings! How may I help you?", getReply(npc));
- assertTrue(en.step(player, "bye"));
- assertEquals("Bye.", getReply(npc));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement