March 2018
Intermediate to advanced
324 pages
8h 30m
English
Now that we have declared what the default response is (No winner), it's time to start working on different winning conditions:
@Test
public void whenPlayAndWholeHorizontalLineThenWinner() {
ticTacToe.play(1, 1); // X
ticTacToe.play(1, 2); // O
ticTacToe.play(2, 1); // X
ticTacToe.play(2, 2); // O
String actual = ticTacToe.play(3, 1); // X
assertEquals("X is the winner", actual);
}
Read now
Unlock full access