コード例 #1
0
        public void Test10PairsOf9AndMiss()
        {
            var game = new BowlingGame();

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

            Assert.Equal(90, game.Score);
        }
コード例 #2
0
        public void Test10PairsOf5AndSparePlus5()
        {
            var game = new BowlingGame();

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

            Assert.Equal(150, game.Score);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        public void TestRollsAllEmpty()
        {
            var game = new BowlingGame();

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

            Assert.Equal(0, game.Score);
        }
コード例 #5
0
        public void TestBowlsAPerfectGame()
        {
            var game = new BowlingGame();

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

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

            game.Roll(3);

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