Ejemplo n.º 1
0
        public void ManualBowlNoPinsSent()
        {
            var pinsBowled = 0;

            var game = new ManualGame();

            var roll = game.Bowl();

            Assert.AreEqual(pinsBowled, roll.PinsBowled, $@"Expected Pins Bowled {pinsBowled}, Actual Pins Bowled {roll.PinsBowled}");
        }
Ejemplo n.º 2
0
        public void ManualGameNoExtraRoll_GameIsFinished()
        {
            var isFinished = true;

            var game = new ManualGame();

            for (int i = 0; i < 20; i++)
            {
                game.PinsBowled = 4;
                game.Bowl();
            }

            Assert.AreEqual(isFinished, game.IsFinished, $@"Expected Game Finished {isFinished}, Actual Game Finished {game.IsFinished}");
        }
Ejemplo n.º 3
0
        public void EnterPinsKnockedDown()
        {
            var bowl1           = 10;
            var bowl2           = 8;
            var bowl3           = 8;
            var bowl4           = 2;
            var bowl5           = 9;
            var bowl6           = 0;
            var score           = 54;
            var frameOneTotal   = 26;
            var frameTwoTotal   = 19;
            var frameThreeTotal = 9;

            var game = new ManualGame();

            game.PinsBowled = bowl1;
            game.Bowl();

            game.PinsBowled = bowl2;
            game.Bowl();

            game.PinsBowled = bowl3;
            game.Bowl();

            game.PinsBowled = bowl4;
            game.Bowl();

            game.PinsBowled = bowl5;
            game.Bowl();

            game.PinsBowled = bowl6;
            game.Bowl();

            Assert.AreEqual(score, game.Score, $@"Expected score {score} Game score {game.Score}");
            Assert.AreEqual(frameOneTotal, game.Frames[0].Total, $@"Expected total {frameOneTotal} Frame total {game.Frames[0].Total}");
            Assert.AreEqual(frameTwoTotal, game.Frames[1].Total, $@"Expected total {frameTwoTotal} Frame total {game.Frames[1].Total}");
            Assert.AreEqual(frameThreeTotal, game.Frames[2].Total, $@"Expected total {frameThreeTotal} Frame total {game.Frames[2].Total}");
        }