Browse Source

added Test for findCellByString

remotes/origin/player
fdai7910 11 months ago
parent
commit
2f409d259e
  1. 18
      src/test/java/pacmanTests/MapTest.java

18
src/test/java/pacmanTests/MapTest.java

@ -58,4 +58,22 @@ class MapTest {
assertThat(expectedMiddle).isEqualTo(middle); assertThat(expectedMiddle).isEqualTo(middle);
assertThat(expectedBottomRight).isEqualTo(bottomRight); 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);
}
} }
Loading…
Cancel
Save