Example #1
0
        public void GutterGame()
        {
            BowlingGame game = new BowlingGame();

            game.roll(0);
            game.roll(0);
            game.roll(0);
            game.roll(0);
            game.roll(0);
            game.roll(0);
            game.roll(0);
            game.roll(0);
            game.roll(0);
            game.roll(0);
            game.roll(0);
            game.roll(0);
            game.roll(0);
            game.roll(0);
            game.roll(0);
            game.roll(0);
            game.roll(0);
            game.roll(0);
            game.roll(0);
            game.roll(0);

            Assert.AreEqual(0, game.score());
        }
Example #2
0
        public void ExampleScore()
        {
            BowlingGame game = new BowlingGame();

            game.roll(1);
            game.roll(4);
            game.roll(4);
            game.roll(5);
            game.roll(6);
            game.roll(4);
            game.roll(5);
            game.roll(5);
            game.roll(10);
            game.roll(0);
            game.roll(1);
            game.roll(7);
            game.roll(3);
            game.roll(6);
            game.roll(4);
            game.roll(10);
            game.roll(2);
            game.roll(8);
            game.roll(6);

            Assert.AreEqual(133, game.score());
        }
Example #3
0
        public void PerfectGame()
        {
            BowlingGame game = new BowlingGame();

            game.roll(10);
            game.roll(10);
            game.roll(10);
            game.roll(10);
            game.roll(10);
            game.roll(10);
            game.roll(10);
            game.roll(10);
            game.roll(10);
            game.roll(10);
            game.roll(10);
            game.roll(10);

            Assert.AreEqual(300, game.score());
        }