Exemplo n.º 1
0
        public void When_all_rolls_are_strikes()
        {
            BowlingGame game = new BowlingGame();

            Assert.That(game.Score(Enumerable.Repeat(10, 12).ToArray()) == 300);
        }
Exemplo n.º 2
0
        public void Random_Game_Scores()
        {
            BowlingGame game = new BowlingGame();

            Assert.That(game.Score(new[] { 10, 7, 2, 3, 4, 1, 1, 3, 6, 10, 8, 1, 10, 10, 9, 1, 10 }) == 143);
        }
Exemplo n.º 3
0
        public void When_all_rolls_are_spares()
        {
            BowlingGame game = new BowlingGame();

            Assert.That(game.Score(Enumerable.Repeat(5, 21).ToArray()) == 150);
        }
Exemplo n.º 4
0
        public void When_rolling_a_single_strike_and_score_full_frame()
        {
            BowlingGame game = new BowlingGame();

            Assert.That(game.Score(new[] { 10, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }) == 14);
        }
Exemplo n.º 5
0
        public void When_rolling_a_single_strike()
        {
            BowlingGame game = new BowlingGame();

            Assert.That(game.Score(new[] { 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }) == 10);
        }
Exemplo n.º 6
0
        public void When_rolling_a_single_spare_and_score()
        {
            BowlingGame game = new BowlingGame();

            Assert.That(game.Score(new[] { 9, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }) == 12);
        }
Exemplo n.º 7
0
        public void When_all_rolls_are_the_same_no_extra_frames(int roll, int score)
        {
            BowlingGame game = new BowlingGame();

            Assert.That(game.Score(Enumerable.Repeat(roll, 20).ToArray()) == score);
        }