Test – board boundaries II

This test is almost the same as the previous one. This time we should validate the y-axis:

@Test
public void whenYOutsideBoardThenRuntimeException() {
  exception.expect(RuntimeException.class);
  ticTacToe.play(2, 5);
}
When a piece is placed anywhere outside the y-axis, then RuntimeException is thrown.

Get Test-Driven Java Development - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.