diff --git a/README.md b/README.md deleted file mode 100644 index 12ecb7d..0000000 --- a/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# CIiP-WiSe-2021-Projektarbeit-Mensch_Aerger_Dich_Nicht -by Jonas Wagner und Felix Krull - -## Beschreibung Projekt - -## Aufbau Spiel - -## Struktur Code \ No newline at end of file diff --git a/src/main/java/Gameboard.java b/src/main/java/Gameboard.java index 81f54f6..03d5fdb 100644 --- a/src/main/java/Gameboard.java +++ b/src/main/java/Gameboard.java @@ -1,3 +1,6 @@ +import java.lang.reflect.Array; +import java.util.Arrays; + public class Gameboard { int[] board; @@ -19,4 +22,9 @@ public class Gameboard { } } + @Override + public String toString() { + return Arrays.toString(board); + } + } diff --git a/src/test/java/GameboardTest.java b/src/test/java/GameboardTest.java index df0d89c..8d53fdb 100644 --- a/src/test/java/GameboardTest.java +++ b/src/test/java/GameboardTest.java @@ -60,4 +60,16 @@ public class GameboardTest { ); } + @Test + void checkPrintGameboard() { + String expectedResult = "[1, 0, 0, 0, 0, 0, 0, 0, 0, 2, " + + "1, 0, 0, 0, 0, 0, 0, 0, 0, 2, " + + "1, 0, 0, 0, 0, 0, 0, 0, 0, 2, " + + "1, 0, 0, 0, 0, 0, 0, 0, 0, 2, " + + "3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3]"; + gb.initGameboard(); + String calculatedResult = gb.toString(); + assertThat(calculatedResult).describedAs("Print Gameboard").isEqualTo(expectedResult); + } + }