- 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.
推薦閱讀
- 從零開始構建企業級RAG系統
- Python程序設計教程(第2版)
- C語言程序設計案例教程(第2版)
- Python Tools for Visual Studio
- C語言程序設計
- 名師講壇:Java微服務架構實戰(SpringBoot+SpringCloud+Docker+RabbitMQ)
- MATLAB for Machine Learning
- Machine Learning in Java
- Deep Learning with R Cookbook
- Greenplum構建實時數據倉庫實踐
- Learn Linux Quickly
- C語言編程魔法書:基于C11標準
- JavaScript設計模式與開發實踐
- Implementing NetScaler VPX?(Second Edition)
- 三步學Python