Esempio n. 1
0
        public void FrameWithSpareIsSpare()
        {
            var frame = new Frame();

            frame.AddThrow(4);
            frame.AddThrow(6);

            Assert.IsTrue(frame.IsSpare());
        }
Esempio n. 2
0
        private int CalculateScore(Frame frame, int currentFrameNumber)
        {
            int score = frame.ScoreInFrame();

            if (frame.IsSpare())
            {
                score += CalculateSpareScore(currentFrameNumber);
            }
            else if (frame.IsStrike())
            {
                score += CalculateStrikeScore(currentFrameNumber);
            }

            return score;
        }