Browse Source

tictactoe: refactored test case and added cases to check draw

tictactoe
Malte Schellhardt 2 years ago
committed by Lorenz Hohmann
parent
commit
64b3f88e93
  1. 18
      src/test/java/de/tims/tictactoe/GameLogicTest.java

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

@ -150,10 +150,6 @@ class GameLogicTest {
{{'o', '-', '-'},
{'o', '-', '-'},
{'o', '-', '-'}}),
Arguments.of("check win in column 0 for player 2", 'o', false, new char[][]
{{'o', '-', '-'},
{'o', '-', '-'},
{'-', '-', '-'}}),
Arguments.of("check win in row 0 for player 1", 'x', true, new char[][]
{{'x', 'x', 'x'},
{'-', '-', '-'},
@ -193,7 +189,19 @@ class GameLogicTest {
Arguments.of("check win in row 2 for player 2 with full board", 'o', true, new char[][]
{{'x', 'x', 'o'},
{'o', 'x', 'x'},
{'o', 'o', 'o'}})
{'o', 'o', 'o'}}),
Arguments.of("check win in column 0 for player 2", 'o', false, new char[][]
{{'o', '-', '-'},
{'o', '-', '-'},
{'-', '-', '-'}}),
Arguments.of("check a draw for player 2", 'o', false, new char[][]
{{'o', 'o', 'x'},
{'o', 'o', 'x'},
{'x', 'x', 'o'}}),
Arguments.of("check a draw for player 1", 'x', false, new char[][]
{{'o', 'o', 'x'},
{'o', 'o', 'x'},
{'x', 'x', 'o'}})
);
}

Loading…
Cancel
Save