Test – O plays right after X

Now, we should make sure that players are changing. After X is finished, it should be O's turn, then again X, and so on:

@Test
public void givenLastTurnWasXWhenNextPlayerThenO() { ticTacToe.play(1, 1); assertEquals('O', ticTacToe.nextPlayer()); }

If the last turn was played by X, then the next turn should be played by O.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.185.87