- 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.
推薦閱讀
- Vue.js 3.x快速入門
- Web應(yīng)用系統(tǒng)開發(fā)實(shí)踐(C#)
- Python數(shù)據(jù)可視化:基于Bokeh的可視化繪圖
- OpenMP核心技術(shù)指南
- Vue.js 3.x高效前端開發(fā)(視頻教學(xué)版)
- 分布式系統(tǒng)架構(gòu)與開發(fā):技術(shù)原理與面試題解析
- Java Web入門很輕松(微課超值版)
- Java EE 程序設(shè)計(jì)
- Practical Time Series Analysis
- Java語言GUI程序設(shè)計(jì)
- Mastering Linux Kernel Development
- 零基礎(chǔ)學(xué)Java(升級(jí)版)
- C++游戲設(shè)計(jì)案例教程
- 構(gòu)建跨平臺(tái)APP:響應(yīng)式UI設(shè)計(jì)入門
- Java程序員面試筆試真題庫(kù)