Beispiel #1
0
        public void LastFrameShouldSimplyAddAllThreeBallsUp()
        {
            //given
            var lastFrame = new LastFrame(1, 2, 3);

            //when
            var score = lastFrame.Score;

            //then
            Assert.AreEqual(6, score);
        }
Beispiel #2
0
        public void FrameShouldIncludeNextTwoBallsAsBonusWhenNextToStrikeIsLastFrame()
        {
            //given
            var frame = new Frame(10, 0);
            var frame2 = new LastFrame(10, 3, 4);
            frame.Next = frame2;

            //when
            var score = frame.Score;

            //then
            Assert.AreEqual(23, score);
        }
Beispiel #3
0
 private Frame CreateFrame(int firstBall, int secondBall, int thirdBall)
 {
     Frame frame;
     if (thirdBall == -1)
     {
         frame = new Frame(firstBall, secondBall);
     }
     else
     {
         CheckLastPosition();
         frame = new LastFrame(firstBall, secondBall, thirdBall);
     }
     return frame;
 }
Beispiel #4
0
        private Frame CreateFrame(int firstBall, int secondBall, int thirdBall)
        {
            Frame frame;

            if (thirdBall == -1)
            {
                frame = new Frame(firstBall, secondBall);
            }
            else
            {
                CheckLastPosition();
                frame = new LastFrame(firstBall, secondBall, thirdBall);
            }
            return(frame);
        }
Beispiel #5
0
 public void ThridBallShouldNotBeBiggerThan10()
 {
     var lastFrame = new LastFrame(1, 2, 13);
     var score = lastFrame.Score;
 }