diff --git a/src/main/java/Gameboard.java b/src/main/java/Gameboard.java new file mode 100644 index 0000000..9dc4cd4 --- /dev/null +++ b/src/main/java/Gameboard.java @@ -0,0 +1,8 @@ +public class Gameboard { + int[][] board; + + public Gameboard() { + board = new int[11][11]; + } + +} diff --git a/src/test/java/GameboardTest.java b/src/test/java/GameboardTest.java new file mode 100644 index 0000000..f5b38ac --- /dev/null +++ b/src/test/java/GameboardTest.java @@ -0,0 +1,36 @@ +import static org.assertj.core.api.Assertions.*; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class GameboardTest { + + private Gameboard gb; + + @BeforeEach + void setup() { + gb = new Gameboard(); + } + + @Test + void checkGameboardSize() { + String expectedResult = "11, 11"; + String currentResult = "" + gb.board.length + ", " + gb.board[0].length; + + assertThat(currentResult).describedAs("Dimensions").isEqualTo(expectedResult); + } + + @Test + void checkGameboardFilled() { + int[][] expectedGameboard = new int[11][11]; + for(int i = 0; i < expectedGameboard.length; i++) { + for(int j = 0; j < expectedGameboard[0].length; j++) { + expectedGameboard[i][j] = 0; + } + } + int [][] givenGameboard = gb.board; + + assertThat(givenGameboard).describedAs("Initial Gameboard").isEqualTo(expectedGameboard); + } + +}