@Test
public void testOnActionPetSheep() {
SheepTestHelper.generateRPClasses();
PetTestHelper.generateRPClasses();
CatTestHelper.generateRPClasses();
final WhereAction pq = new WhereAction();
final RPAction action = new RPAction();
action.put(Actions.TYPE, "where");
action.put(Actions.TARGET, "pet");
Player player = PlayerTestHelper.createPlayer("player");
pq.onAction(player, action);
assertThat(player.events().get(0).get("text"), equalTo("No player or pet named \"pet\" is currently logged in."));
final Pet testPet = new Cat();
final Sheep testSheep = new Sheep();
player = PlayerTestHelper.createPlayer("player");
StendhalRPZone stendhalRPZone = new StendhalRPZone("zone");
MockStendlRPWorld.get().addRPZone(stendhalRPZone);
stendhalRPZone.add(player);
stendhalRPZone.add(testSheep);
stendhalRPZone.add(testPet);
player.setPet(testPet);
pq.onAction(player, action);
assertThat(player.events().get(0).get("text"), equalTo("Your cat is at (0,0)"));
player.clearEvents();
player.setSheep(testSheep);
action.put(Actions.TARGET, "sheep");
pq.onAction(player, action);
assertThat(player.events().get(0).get("text"), equalTo("Your sheep is at (0,0)"));
}