Skip to content

Instantly share code, notes, and snippets.

@stefanhendriks
Created October 11, 2012 21:41
Show Gist options
  • Save stefanhendriks/3875680 to your computer and use it in GitHub Desktop.
Save stefanhendriks/3875680 to your computer and use it in GitHub Desktop.
Bowling game kata test - ultimate test for nasty bug
@Test
public void nastyBug() {
rollStrike();
game.roll(0);
game.roll(10); // spare
game.roll(0);
game.roll(2);
rollMany(14, 0);
Assert.assertEquals(32, game.score());
}
This will occur when the isStrike and isSpare if conditions are in the wrong order. Correct order is:
isStrike
isSpare
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment