diff --git a/src/test/java/pacmanTests/PlayerTest.java b/src/test/java/pacmanTests/PlayerTest.java index 3cd3d87..e30ea0f 100644 --- a/src/test/java/pacmanTests/PlayerTest.java +++ b/src/test/java/pacmanTests/PlayerTest.java @@ -131,4 +131,19 @@ class PlayerTest { // assert assertThat(direction).isEqualTo(expectedDdirection); } + + + @Test + void Player_spawn_setsPosition() { + // arrange + GameManager gameManager = new GameManager(); + Player player = gameManager.player; + + Vector2 expectedPosition = gameManager.map.playerSpawn.Clone(); + // act + player.Spawn(); + Vector2 position = player.position; + // assert + assertThat(position).isEqualTo(expectedPosition); + } }