Browse Source

tictactoe: added test case to check end of game with win for player 1

tictactoe
Malte Schellhardt 2 years ago
committed by Lorenz Hohmann
parent
commit
ef0aac9383
  1. 2
      src/main/java/de/tims/tictactoe/GameLogic.java
  2. 6
      src/test/java/de/tims/tictactoe/GameLogicTest.java

2
src/main/java/de/tims/tictactoe/GameLogic.java

@ -89,7 +89,7 @@ public class GameLogic {
}
public boolean checkEndOfGame() {
// TODO Auto-generated method stub
if (checkForWin('x')) return true;
return false;
}

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

@ -226,7 +226,11 @@ class GameLogicTest {
Arguments.of("check empty board", false, new char[][]
{{'-', '-', '-'},
{'-', '-', '-'},
{'-', '-', '-'}})
{'-', '-', '-'}}),
Arguments.of("end of game with win for player 1", true, new char[][]
{{'x', 'o', 'x'},
{'x', 'x', 'o'},
{'x', 'o', 'o'}})
);
}

Loading…
Cancel
Save