- Test-Driven Java Development(Second Edition)
- Alex Garcia Viktor Farcic
- 71字
- 2021-06-24 18:31:55
Test – winning condition II
We should also check whether there is a win by filling the vertical line:
@Test public void whenPlayAndWholeVerticalLineThenWinner() { ticTacToe.play(2, 1); // X ticTacToe.play(1, 1); // O ticTacToe.play(3, 1); // X ticTacToe.play(1, 2); // O ticTacToe.play(2, 2); // X String actual = ticTacToe.play(1, 3); // O assertEquals("O is the winner", actual); }
The player wins when the whole vertical line is occupied by his pieces.
推薦閱讀
- Delphi程序設計基礎:教程、實驗、習題
- Learn to Create WordPress Themes by Building 5 Projects
- 零基礎玩轉區塊鏈
- 單片機C語言程序設計實訓100例:基于STC8051+Proteus仿真與實戰
- Servlet/JSP深入詳解
- Learning Hunk
- PHP 7+MySQL 8動態網站開發從入門到精通(視頻教學版)
- jQuery Mobile移動應用開發實戰(第3版)
- 搞定J2EE:Struts+Spring+Hibernate整合詳解與典型案例
- Domain-Driven Design in PHP
- 大話Java:程序設計從入門到精通
- 深入理解C指針
- Deep Learning for Natural Language Processing
- C++17 By Example
- Slick2D Game Development