- 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.
推薦閱讀
- UNIX編程藝術
- Google Flutter Mobile Development Quick Start Guide
- Boost程序庫完全開發指南:深入C++”準”標準庫(第5版)
- 精通Nginx(第2版)
- The Android Game Developer's Handbook
- CMDB分步構建指南
- 新手學Visual C# 2008程序設計
- C語言課程設計
- C程序設計實踐教程
- 批調度與網絡問題的組合算法
- 運維前線:一線運維專家的運維方法、技巧與實踐
- App Inventor 2 Essentials
- SwiftUI極簡開發
- 官方 Scratch 3.0 編程趣味卡:讓孩子們愛上編程(全彩)
- 大規模語言模型開發基礎與實踐