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

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.

主站蜘蛛池模板: 鹰潭市| 昭平县| 保康县| 名山县| 平乐县| 林口县| 富顺县| 嵊泗县| 容城县| 方城县| 舟山市| 迭部县| 合江县| 邮箱| 福清市| 巩留县| 尤溪县| 河池市| 德江县| 彩票| 交口县| 天门市| 吴堡县| 仙居县| 建始县| 胶南市| 太和县| 寿宁县| 兰考县| 大埔区| 长白| 连南| 腾冲县| 东城区| 永昌县| 策勒县| 平远县| 舞钢市| 怀安县| 澜沧| 栾川县|