|
|
@ -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); |
|
|
|
} |
|
|
|
} |