- 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.
推薦閱讀
- 零基礎學Java程序設計
- Effective Python Penetration Testing
- 微信公眾平臺開發:從零基礎到ThinkPHP5高性能框架實踐
- PySide GUI Application Development(Second Edition)
- 飛槳PaddlePaddle深度學習實戰
- 人工智能算法(卷1):基礎算法
- 數據科學中的實用統計學(第2版)
- INSTANT JQuery Flot Visual Data Analysis
- SSH框架企業級應用實戰
- Solr權威指南(下卷)
- Test-Driven iOS Development with Swift
- Developing Java Applications with Spring and Spring Boot
- Spring Boot學習指南:構建云原生Java和Kotlin應用程序
- R語言:邁向大數據之路
- Python量子計算實踐:基于Qiskit和IBM Quantum Experience平臺