public void OnlyStrikesScores300() { var game = new Game(); RollMany(game, 12, 10); Assert.That(game.Score(), Is.EqualTo(300)); }
public void OnlyFiveRollsScores150() { var game = new Game(); RollMany(game, 21, 5); Assert.That(game.Score(), Is.EqualTo(150)); }
public void RollOneReturnsResultOne() { var game = new Game(); game.Roll(1); game.Roll(0); RollMany(game, 18, 0); Assert.That(game.Score(), Is.EqualTo(1)); }
public void RollAllOnesShouldReturn20() { var game = new Game(); for (int i = 0; i < 20; i++) { game.Roll(1); } Assert.That(game.Score(), Is.EqualTo(20)); }
public void SingleStrikeShouldScore() { var game = new Game(); game.Roll(10); game.Roll(1); game.Roll(1); RollMany(game, 16, 0); Assert.That(game.Score(), Is.EqualTo(14)); }
public void DoubleStrikeShouldScore() { var game = new Game(); game.Roll(10); game.Roll(10); game.Roll(1); game.Roll(2); RollMany(game, 14, 0); Assert.That(game.Score(), Is.EqualTo(21+13+3)); }
public void StrikeAfterSpareShouldScore() { var game = new Game(); game.Roll(3); game.Roll(7); game.Roll(10); game.Roll(1); game.Roll(2); RollMany(game, 14, 0); Assert.That(game.Score(), Is.EqualTo(20+13+3)); }
private void RollMany(Game game, int times, int pins) { for (int i = 0; i < times; i++) { game.Roll(pins); } }
public void StrikeAtTheEndShouldScore() { var game = new Game(); RollMany(game,18, 0); game.Roll(10); game.Roll(1); game.Roll(2); Assert.That(game.Score(), Is.EqualTo(13)); }