From 2f409d259e760fd9dbe966f6ca4eef061a16b899 Mon Sep 17 00:00:00 2001 From: fdai7910 Date: Thu, 8 Feb 2024 00:56:13 +0100 Subject: [PATCH] added Test for findCellByString --- src/test/java/pacmanTests/MapTest.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/test/java/pacmanTests/MapTest.java b/src/test/java/pacmanTests/MapTest.java index f94d0bd..57fe927 100644 --- a/src/test/java/pacmanTests/MapTest.java +++ b/src/test/java/pacmanTests/MapTest.java @@ -58,4 +58,22 @@ class MapTest { assertThat(expectedMiddle).isEqualTo(middle); assertThat(expectedBottomRight).isEqualTo(bottomRight); } + + @Test + void Map_findCellByString_cellT() { + // arrange + String[] mapTest = { + "wew", + "w.t", + "ee." + }; + GameManager gameManager = new GameManager(); + gameManager.map = new Map(mapTest, gameManager); + Map testMap = gameManager.map; + Cell expectedT = testMap.cells[2][1]; + // act + Cell foundT = testMap.findCellByString("tpRight"); + // assert + assertThat(expectedT).isEqualTo(foundT); + } }