Browse Source

tictactoe: refactored test cases for checkForWin method

tictactoe
Malte Schellhardt 2 years ago
committed by Lorenz Hohmann
parent
commit
54097b5c02
  1. 24
      src/test/java/de/tims/tictactoe/GameLogicTest.java

24
src/test/java/de/tims/tictactoe/GameLogicTest.java

@ -134,18 +134,18 @@ class GameLogicTest {
private static Stream<Arguments> testCasesForCheckForWin() {
return Stream.of(
Arguments.of("check win for player 1", 'x', true, new char[][]
{{'x', '-', '-'},
{'x', '-', '-'},
{'x', '-', '-'}}),
Arguments.of("check win for player 2", 'o', true, new char[][]
{{'o', '-', '-'},
{'o', '-', '-'},
{'o', '-', '-'}}),
Arguments.of("check win for player 2", 'o', false, new char[][]
{{'o', '-', '-'},
{'o', '-', '-'},
{'-', '-', '-'}})
Arguments.of("check win in column 0 for player 1", 'x', true, new char[][]
{{'x', '-', '-'},
{'x', '-', '-'},
{'x', '-', '-'}}),
Arguments.of("check win in column 0 for player 2", 'o', true, new char[][]
{{'o', '-', '-'},
{'o', '-', '-'},
{'o', '-', '-'}}),
Arguments.of("check win in column 0 for player 2", 'o', false, new char[][]
{{'o', '-', '-'},
{'o', '-', '-'},
{'-', '-', '-'}})
);
}

Loading…
Cancel
Save