Skip to content

Instantly share code, notes, and snippets.

@gonzalezgarciacristian
Last active April 20, 2017 13:53
Show Gist options
  • Save gonzalezgarciacristian/bad9279e072e48f5b24d687710a0ebd3 to your computer and use it in GitHub Desktop.
Save gonzalezgarciacristian/bad9279e072e48f5b24d687710a0ebd3 to your computer and use it in GitHub Desktop.
package tests;
import static org.junit.Assert.*;
import org.junit.Test;
import models.Player;
import models.NPC;
import models.Place;
public class ClassUnitTest {
private NPC npc;
private Place place;
private Player player;
public ClassUnitTest() {
this.npc = new NPC("Blacksmith", 1, 2);
this.place = new Place("Prontera", this.npc);
this.player = new Player("Emanie");
}
@Test
public void testNPC1() {
assertEquals(npc.getName(), "Blacksmith");
}
@Test
public void testNPC2() {
assertEquals(npc.getX(), 1);
}
@Test
public void testNPC3() {
assertEquals(npc.getY(), 2);
}
@Test
public void testPlayer() {
assertEquals(player.getName(), "Emanie");
}
@Test
public void testPlace1() {
place.setPlayer(player);
assertEquals(place.getPlayer().getName(), "Emanie");
}
@Test
public void testPlace2() {
place.setNPC(npc);
assertEquals(place.getNPC().getName(), "Blacksmith");
}
@Test
public void testPlace3() {
assertEquals(place.getName(), "Prontera");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment