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

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.

主站蜘蛛池模板: 西乌珠穆沁旗| 乐至县| 朝阳区| 乌苏市| 横山县| 清远市| 凤阳县| 南投市| 开鲁县| 寿宁县| 明溪县| 广昌县| 仁怀市| 宜都市| 综艺| 黔西县| 关岭| 丰县| 蕉岭县| 平罗县| 阿拉善右旗| 惠水县| 吕梁市| 永胜县| 扶风县| 克拉玛依市| 古蔺县| 眉山市| 来安县| 英山县| 新安县| 长岛县| 西贡区| 邵阳市| 澜沧| 锦屏县| 砀山县| 裕民县| 石阡县| 登封市| 常熟市|