コード例 #1
0
        public void bowling_a_strike_2_frames_in_a_row_will_add_the_first_roll_of_the_next_frame_to_the_first_strikes_frame()
        {
            var game = new FrameScorer()
            {
                CurrentFrame = 2, RemainingPins = 5
            };
            var frame1 = new FrameScore()
            {
                Bowl1 = 10, Strike = true
            };
            var frame2 = new FrameScore()
            {
                Bowl1 = 10, Strike = true
            };
            var frame3 = new FrameScore()
            {
                Bowl1 = 5, Bowl2 = 3
            };
            var expectedResult = 25;

            game.FrameList.Add(frame1);
            game.FrameList.Add(frame2);
            game.FrameList.Add(frame3);
            game.StrikeAdder();
            var actualResult = frame1.TotalScore;

            Assert.Equal(expectedResult, actualResult);
        }
コード例 #2
0
        public void bowling_a_strike_followed_by_a_non_strike_will_add_both_bowls_from_the_second_frame_to_the_strike_frame()
        {
            var game = new FrameScorer()
            {
                CurrentFrame = 1, RemainingPins = 2
            };
            var frame1 = new FrameScore()
            {
                Bowl1 = 10, Strike = true
            };
            var frame2 = new FrameScore()
            {
                Bowl1 = 5, Bowl2 = 3
            };
            var expectedResult = 18;

            game.FrameList.Add(frame1);
            game.FrameList.Add(frame2);
            game.StrikeAdder();
            var actualResult = frame1.TotalScore;

            Assert.Equal(expectedResult, actualResult);
        }