官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 南靖县| 彩票| 磴口县| 景谷| 万年县| 上思县| 墨脱县| 永吉县| 邛崃市| 兴城市| 都昌县| 加查县| 柘城县| 永新县| 蒙山县| 汶上县| 塘沽区| 合阳县| 南华县| 花垣县| 宝山区| 和政县| 水富县| 秭归县| 盐城市| 兖州市| 敦化市| 五台县| 贞丰县| 浦城县| 汽车| 利川市| 玉田县| 蓝田县| 沛县| 普兰县| 澜沧| 双鸭山市| 贵定县| 宁化县| 安国市|