- 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.
推薦閱讀
- SpringMVC+MyBatis快速開發與項目實戰
- 騰訊iOS測試實踐
- C#程序設計(慕課版)
- C語言程序設計實踐教程
- The HTML and CSS Workshop
- Unreal Engine 4 Shaders and Effects Cookbook
- C語言程序設計教程
- C語言程序設計
- 第一行代碼 C語言(視頻講解版)
- 從零學Java設計模式
- Application Development with Parse using iOS SDK
- 自己動手做智能產品:嵌入式JavaScript實現
- 深入理解C++11:C++11新特性解析與應用
- Mastering Java 11
- 寫給設計師的技術書:從智能終端到感知交互