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

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.

主站蜘蛛池模板: 蒲城县| 高碑店市| 泰州市| 海伦市| 柯坪县| 嫩江县| 竹山县| 射洪县| 黔西| 金门县| 天等县| 清水县| 巩留县| 云龙县| 青铜峡市| 肥乡县| 万安县| 饶平县| 宣恩县| 日照市| 彰武县| 彰武县| 墨竹工卡县| 扎赉特旗| 铁岭县| 房产| 日喀则市| 梁山县| 广平县| 紫云| 临武县| 图们市| 昆明市| 平和县| 巩留县| 长垣县| 五台县| 新化县| 辽宁省| 西昌市| 伊金霍洛旗|