- 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.
推薦閱讀
- INSTANT Mock Testing with PowerMock
- .NET之美:.NET關鍵技術深入解析
- Debian 7:System Administration Best Practices
- React Native Cookbook
- C++程序設計基礎教程
- Unity 2017 Mobile Game Development
- OpenGL Data Visualization Cookbook
- TMS320LF240x芯片原理、設計及應用
- 汽車人機交互界面整合設計
- Buildbox 2.x Game Development
- Visual Basic程序設計(第三版)
- Clojure Web Development Essentials
- Java程序設計入門(第2版)
- Android開發進階實戰:拓展與提升
- R語言:邁向大數據之路