- 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.
推薦閱讀
- HTML5+CSS3王者歸來
- Spring 5企業(yè)級開發(fā)實戰(zhàn)
- Java Web基礎(chǔ)與實例教程(第2版·微課版)
- Web Scraping with Python
- jQuery EasyUI網(wǎng)站開發(fā)實戰(zhàn)
- Web Development with Django Cookbook
- AngularJS深度剖析與最佳實踐
- Learning Laravel's Eloquent
- 基于SpringBoot實現(xiàn):Java分布式中間件開發(fā)入門與實戰(zhàn)
- Python項目實戰(zhàn)從入門到精通
- 從零開始學(xué)Android開發(fā)
- ASP.NET Web API Security Essentials
- 從零學(xué)Java設(shè)計模式
- Unity Certified Programmer:Exam Guide
- Instant OpenCV for iOS