|
@ -2,6 +2,7 @@ package org.bitbiome.entitiesTest; |
|
|
|
|
|
|
|
|
import static org.junit.jupiter.api.Assertions.assertEquals; |
|
|
import static org.junit.jupiter.api.Assertions.assertEquals; |
|
|
|
|
|
|
|
|
|
|
|
import org.bitbiome.entities.Location; |
|
|
import org.bitbiome.entities.Player; |
|
|
import org.bitbiome.entities.Player; |
|
|
import org.junit.jupiter.api.BeforeAll; |
|
|
import org.junit.jupiter.api.BeforeAll; |
|
|
import org.junit.jupiter.api.Test; |
|
|
import org.junit.jupiter.api.Test; |
|
@ -9,12 +10,17 @@ import org.junit.jupiter.api.Test; |
|
|
public class PlayerTest { |
|
|
public class PlayerTest { |
|
|
|
|
|
|
|
|
private static Player player; |
|
|
private static Player player; |
|
|
|
|
|
private static Location location; |
|
|
|
|
|
|
|
|
@BeforeAll |
|
|
@BeforeAll |
|
|
public static void setPlayer() { |
|
|
public static void setPlayer() { |
|
|
player = new Player(); |
|
|
player = new Player(); |
|
|
|
|
|
location = new Location(); |
|
|
|
|
|
|
|
|
|
|
|
location.setName("NewUnitWorld"); |
|
|
|
|
|
|
|
|
player.setName("UnitPlayer"); |
|
|
player.setName("UnitPlayer"); |
|
|
|
|
|
player.setLocation(location); |
|
|
player.setHp(100F); |
|
|
player.setHp(100F); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -29,4 +35,9 @@ public class PlayerTest { |
|
|
assertEquals(100F, player.getHp()); |
|
|
assertEquals(100F, player.getHp()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
public void testLocationNameFromPlayer() { |
|
|
|
|
|
assertEquals("NewUnitWorld", player.getLocation().getName()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |