- 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.
推薦閱讀
- Microsoft Exchange Server PowerShell Cookbook(Third Edition)
- 造個(gè)小程序:與微信一起干件正經(jīng)事兒
- 從程序員到架構(gòu)師:大數(shù)據(jù)量、緩存、高并發(fā)、微服務(wù)、多團(tuán)隊(duì)協(xié)同等核心場(chǎng)景實(shí)戰(zhàn)
- PostgreSQL技術(shù)內(nèi)幕:事務(wù)處理深度探索
- Apache Mesos Essentials
- Mastering Apache Spark 2.x(Second Edition)
- Building an RPG with Unity 2018
- Extending Puppet(Second Edition)
- Learning Laravel's Eloquent
- Mastering Unity 2D Game Development(Second Edition)
- 0 bug:C/C++商用工程之道
- Scala編程(第5版)
- 深入理解Kafka:核心設(shè)計(jì)與實(shí)踐原理
- JavaScript Concurrency
- Python趣味創(chuàng)意編程