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

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.

主站蜘蛛池模板: 宁波市| 夏河县| 敦煌市| 财经| 隆回县| 泰来县| 合江县| 威海市| 翁源县| 田东县| 安多县| 大足县| 西畴县| 兴化市| 曲阳县| 隆子县| 汨罗市| 陆良县| 吉隆县| 根河市| 曲麻莱县| 万山特区| 额济纳旗| 沙坪坝区| 商都县| 陆川县| 许昌县| 北海市| 沙湾县| 收藏| 调兵山市| 栾城县| 东源县| 蒙阴县| 河曲县| 武义县| 井陉县| 新昌县| 县级市| 华容县| 上杭县|