March 2018
Intermediate to advanced
324 pages
8h 30m
English
We can test the draw result by filling all the board's boxes:
@Test
public void whenAllBoxesAreFilledThenDraw() {
ticTacToe.play(1, 1);
ticTacToe.play(1, 2);
ticTacToe.play(1, 3);
ticTacToe.play(2, 1);
ticTacToe.play(2, 3);
ticTacToe.play(2, 2);
ticTacToe.play(3, 1);
ticTacToe.play(3, 3);
String actual = ticTacToe.play(3, 2);
assertEquals("The result is draw", actual);
}
Read now
Unlock full access