From 0d8056770591e45bf1c3f15f3c06c51c70e10961 Mon Sep 17 00:00:00 2001 From: fdai7012 Date: Thu, 8 Feb 2024 18:04:05 +0100 Subject: [PATCH] changes distance because of random behavior in test --- src/test/java/pacmanTests/GhostTest.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/test/java/pacmanTests/GhostTest.java b/src/test/java/pacmanTests/GhostTest.java index 34df89b..2b995ab 100644 --- a/src/test/java/pacmanTests/GhostTest.java +++ b/src/test/java/pacmanTests/GhostTest.java @@ -58,22 +58,23 @@ class GhostTest { void Ghost_chase_chasesPlayer() { // arrange String[] mapTest = { - "wwwww", - "w...w", - "wwwww" + "wwwwwwwwwwwwwwwwwwwwwwwwwwww", + "w..........................w", + "wwwwwwwwwwwwwwwwwwwwwwwwwwww" }; GameManager gameManager = new GameManager(); gameManager.map = new Map(mapTest, gameManager); - Vector2 expectedGhostPos = new Vector2(2, 1); + Vector2 expectedGhostPos = new Vector2(24, 1); gameManager.player.position = new Vector2(1, 1); - gameManager.ghosts[0].position = new Vector2(3, 1); + gameManager.ghosts[0].position = new Vector2(25, 1); // act gameManager.ghosts[0].move(); Vector2 ghostPos = gameManager.ghosts[0].position; - + // assert assertThat(ghostPos).isEqualTo(expectedGhostPos); } + } \ No newline at end of file