Browse Source

tictactoe: added test case for new parameterized constructor

tictactoe
Malte Schellhardt 3 years ago
committed by Lorenz Hohmann
parent
commit
aad95ece07
  1. 11
      src/test/java/de/tims/tictactoe/GameLogicTest.java

11
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) {

Loading…
Cancel
Save