March 2018
Intermediate to advanced
324 pages
8h 30m
English
Player X has the first turn:
@Test
public void givenFirstTurnWhenNextPlayerThenX() {
assertEquals('X', ticTacToe.nextPlayer());
}
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.
Read now
Unlock full access