|
|
@ -108,4 +108,19 @@ class GameManagerTest { |
|
|
|
boolean expected = true; |
|
|
|
assertThat(pause).isEqualTo(expected); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
void GameManager_spawnFruit_spawnsFruitAtPlayerSpawn() { |
|
|
|
//arrange |
|
|
|
GameManager gameManager = new GameManager(); |
|
|
|
Cell fruitSpawn = gameManager.map.getCell(gameManager.map.playerSpawn); |
|
|
|
String[] expected = {"cherry","strawberry","orange","apple","crystal"}; |
|
|
|
//act |
|
|
|
|
|
|
|
gameManager.spawnFruit(); |
|
|
|
String result = fruitSpawn.type; |
|
|
|
//assert |
|
|
|
assertThat(result).isIn(expected); |
|
|
|
} |
|
|
|
} |