- Test-Driven Java Development(Second Edition)
- Alex Garcia Viktor Farcic
- 84字
- 2021-06-24 18:31:53
Test – X plays first
Player X has the first turn:
@Test public void givenFirstTurnWhenNextPlayerThenX() { assertEquals('X', ticTacToe.nextPlayer()); }
The first turn should be played by Player X.
This test should be self-explanatory. We are expecting the nextPlayer method to return X. If you try to run this, you'll see that the code does not even compile. That's because the nextPlayer method does not even exist. Our job is to write the nextPlayer method and make sure that it returns the correct value.
推薦閱讀
- Python數據分析基礎
- 精通軟件性能測試與LoadRunner實戰(第2版)
- 零基礎學Java程序設計
- Java EE 7 Development with NetBeans 8
- Python編程與幾何圖形
- 從0到1:Python數據分析
- Raspberry Pi Robotic Projects(Third Edition)
- Python Interviews
- 零基礎學HTML+CSS第2版
- Mapping with ArcGIS Pro
- Visual Basic語言程序設計上機指導與練習(第3版)
- 基于JavaScript的WebGIS開發
- 川哥教你Spring Boot 2實戰
- ASP.NET Core 2 High Performance(Second Edition)
- Visual FoxPro程序設計實驗教程