Browse Source

added test for player spawning

main
fdai7012 11 months ago
parent
commit
917c968b14
  1. 15
      src/test/java/pacmanTests/PlayerTest.java

15
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);
}
}
Loading…
Cancel
Save