public void Test10PairsOf9AndMiss()
        {
            var game = new BowlingGame();

            Repeat(() => { game.Roll(9); game.Roll(0); }, 10);

            Assert.Equal(90, game.Score);
        }
        public void Test10PairsOf5AndSparePlus5()
        {
            var game = new BowlingGame();

            Repeat(() => game.Roll(5), 20);
            game.Roll(5);

            Assert.Equal(150, game.Score);
        }
        public void TestOnlyRollsStrikeInFirstFrame()
        {
            var game = new BowlingGame();

            Repeat(() => game.Roll(10), 1);
            Repeat(() => game.Roll(1), 18);

            Assert.Equal(10 + 1 + 1 + 18, game.Score);
        }
        public void TestRollsAllEmpty()
        {
            var game = new BowlingGame();

            Repeat(() => game.Roll(0), 20);

            Assert.Equal(0, game.Score);
        }
        public void TestBowlsAPerfectGame()
        {
            var game = new BowlingGame();

            Repeat(() => game.Roll(10), 12);

            Assert.Equal(300, game.Score);
        }
Example #6
0
        public void Score_OneRoll_ShouldReturnRolledAmount()
        {
            BowlingGame game = new BowlingGame();

            game.Roll(3);

            Assert.Equal(3, game.Score());
        }