From aad95ece07c2beaa50e3124fbbcdc631d02cc2a6 Mon Sep 17 00:00:00 2001 From: Malte Schellhardt Date: Wed, 9 Feb 2022 16:31:44 +0100 Subject: [PATCH] tictactoe: added test case for new parameterized constructor --- src/test/java/de/tims/tictactoe/GameLogicTest.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/test/java/de/tims/tictactoe/GameLogicTest.java b/src/test/java/de/tims/tictactoe/GameLogicTest.java index 9e08172..4c14782 100644 --- a/src/test/java/de/tims/tictactoe/GameLogicTest.java +++ b/src/test/java/de/tims/tictactoe/GameLogicTest.java @@ -42,6 +42,17 @@ class GameLogicTest { assertArrayEquals(expectedResult, realResult); } + @Test + void createGameLogicWithGivenBoardTest() { + char[][] expectedResult = new char[][]{{'x', '-', '-'}, + {'-', 'o', '-'}, + {'x', '-', '-'}}; + char[][] givenBoard = expectedResult; + char[][] realResult = new GameLogic(givenBoard).getBoard(); + + assertArrayEquals(expectedResult, realResult); + } + @ParameterizedTest(name = "[{index}] {0} -> {2} fields") @MethodSource("testCasesForCountPlayfields") void fieldCountTest(String testName, int size, int expectedResult) {