|
|
@ -75,4 +75,17 @@ class GameManagerTest { |
|
|
|
// assert |
|
|
|
assertThat(colision).isEqualTo(expected); |
|
|
|
} |
|
|
|
@Test |
|
|
|
void GameManager_setupgame_spawnsghosts() { |
|
|
|
|
|
|
|
// arrange |
|
|
|
GameManager gameManager = new GameManager(); |
|
|
|
gameManager.map.ghostSpawns[0] = new Vector2(1, 1); |
|
|
|
Vector2 expectedPosition = new Vector2(1, 1); |
|
|
|
// act |
|
|
|
gameManager.ghosts[0].spawn(); |
|
|
|
Vector2 ghostPositeion = gameManager.ghosts[0].position; |
|
|
|
// assert |
|
|
|
assertThat(ghostPositeion).isEqualTo(expectedPosition); |
|
|
|
} |
|
|
|
} |