- Test-Driven Java Development(Second Edition)
- Alex Garcia Viktor Farcic
- 74字
- 2021-06-24 18:31:53
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.
推薦閱讀
- Android項目開發入門教程
- Learning Selenium Testing Tools with Python
- Mastering Swift 2
- C++程序設計基礎教程
- 用Flutter極速構建原生應用
- MongoDB權威指南(第3版)
- Learning Hunk
- 程序是怎樣跑起來的(第3版)
- 數據結構與算法分析(C++語言版)
- FPGA Verilog開發實戰指南:基于Intel Cyclone IV(進階篇)
- Node.js:來一打 C++ 擴展
- Python極簡講義:一本書入門數據分析與機器學習
- 響應式架構:消息模式Actor實現與Scala、Akka應用集成
- Python深度學習(第2版)
- Processing開發實戰