Last active
April 20, 2017 13:53
-
-
Save gonzalezgarciacristian/bad9279e072e48f5b24d687710a0ebd3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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