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

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.

主站蜘蛛池模板: 南靖县| 大邑县| 新密市| 海林市| 林甸县| 莒南县| 乳山市| 绩溪县| 嘉兴市| 温泉县| 博罗县| 淅川县| 淮安市| 仲巴县| 乳山市| 怀仁县| 昭通市| 石狮市| 鹿泉市| 休宁县| 安多县| 双牌县| 靖江市| 越西县| 静乐县| 开远市| 达拉特旗| 潼南县| 乌拉特中旗| 富川| 金华市| 吉首市| 巴青县| 南投市| 大邑县| 镇原县| 白城市| 兰考县| 鹰潭市| 长兴县| 锡林郭勒盟|