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

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.

主站蜘蛛池模板: 沧州市| 桂阳县| 资兴市| 缙云县| 张北县| 大姚县| 章丘市| 水富县| 嘉义市| 忻州市| 鄂伦春自治旗| 湘西| 远安县| 乌兰浩特市| 红原县| 景宁| 涞水县| 郎溪县| 邓州市| 绥江县| 横山县| 广安市| 小金县| 枝江市| 莱阳市| 香港 | 遂昌县| 塔城市| 昌吉市| 历史| 怀安县| 越西县| 潼关县| 从化市| 灵宝市| 江都市| 株洲县| 通化市| 安多县| 佛教| 天水市|