- Test-Driven Java Development(Second Edition)
- Alex Garcia Viktor Farcic
- 74字
- 2021-06-24 18:31:55
Test – winning condition I
Now that we have declared what the default response is (No winner), it's time to start working on different winning conditions:
@Test public void whenPlayAndWholeHorizontalLineThenWinner() { ticTacToe.play(1, 1); // X ticTacToe.play(1, 2); // O ticTacToe.play(2, 1); // X ticTacToe.play(2, 2); // O String actual = ticTacToe.play(3, 1); // X assertEquals("X is the winner", actual); }
The player wins when the whole horizontal line is occupied by his pieces.
推薦閱讀
- 軟件安全技術
- JavaScript:Functional Programming for JavaScript Developers
- SQL Server 2012數據庫技術及應用(微課版·第5版)
- Django Design Patterns and Best Practices
- 精通MATLAB(第3版)
- SQL Server與JSP動態網站開發
- Python算法詳解
- 基于ARM Cortex-M4F內核的MSP432 MCU開發實踐
- R數據科學實戰:工具詳解與案例分析
- Programming Microsoft Dynamics? NAV 2015
- FFmpeg開發實戰:從零基礎到短視頻上線
- Scala Functional Programming Patterns
- C語言程序設計
- INSTANT Apache ServiceMix How-to
- Android編程權威指南(第4版)