官术网_书友最值得收藏!

Test – occupied spot

Now that we know that pieces are placed within the board's boundaries, we should make sure that they can be placed only on unoccupied spaces:

@Test 
public void whenOccupiedThenRuntimeException() { 
  ticTacToe.play(2, 1); 
  exception.expect(RuntimeException.class); 
  ticTacToe.play(2, 1); 
} 

When a piece is placed on an occupied space, then RuntimeException is thrown.

That's it; this was our last test. Once the implementation is finished, we can consider the first requirement as done.

主站蜘蛛池模板: 青州市| 长白| 海宁市| 通许县| 林甸县| 历史| 南昌市| 宁强县| 青阳县| 本溪| 南和县| 西吉县| 新乡县| 葵青区| 桃园市| 元江| 元氏县| 济阳县| 咸阳市| 洪江市| 晋宁县| 久治县| 曲水县| 普定县| 烟台市| 商河县| 金山区| 新密市| 高唐县| 大宁县| 淮阳县| 武功县| 乌海市| 利川市| 吴旗县| 闸北区| 灌南县| 渭源县| 诸城市| 宁津县| 青岛市|