Browse Source

Refactoring: testGameOver implement better with the for loop

main
fdai2751 11 months ago
parent
commit
09be8bfa4d
  1. 7
      src/test/java/pacmanTests/GameManagerTest.java

7
src/test/java/pacmanTests/GameManagerTest.java

@ -70,9 +70,10 @@ class GameManagerTest {
GameManager game = new GameManager();
game.score = 100;
game.handleGhostCollision();
game.handleGhostCollision();
game.handleGhostCollision();
for(int i = 0;i < 3; i++) {
game.handleGhostCollision();
}
int expectedScore = 0;
assertThat(game.score).isEqualTo(expectedScore);
}

Loading…
Cancel
Save