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