Browse Source

Test: JunitTest TestgameOver afterTree Collision With Ghosts

main
fdai2751 11 months ago
parent
commit
3f7d2645b3
  1. 16
      src/test/java/pacmanTests/GameManagerTest.java

16
src/test/java/pacmanTests/GameManagerTest.java

@ -64,6 +64,22 @@ class GameManagerTest {
game.Pause(); game.Pause();
assertTrue(game.isPaused); assertTrue(game.isPaused);
} }
@Test
void testGameOverwhenGhostCaughtPlayer() {
GameManager game = new GameManager();
game.score = 100;
game.handleGhostCollision();
game.handleGhostCollision();
game.handleGhostCollision();
int expectedScore = 0;
assertThat(game.score).isEqualTo(expectedScore);
}
@Test @Test
void GameManager_GostPlayerCollisionTest_DoesntDetectColliosion() { void GameManager_GostPlayerCollisionTest_DoesntDetectColliosion() {

Loading…
Cancel
Save