コード例 #1
0
        public void Given_I_Have_a_frame_with_a_score_of_1_and_a_score_of_1_then_i_will_get_back_spare_bool_false()
        {
            //given i have a frame
            FrameObject frame;

            frame = new FrameObject {
                bowl1 = 1, bowl2 = 1, score = 2
            };
            //when the frame score is calculated
            IDetermineStrikeSpareOpen determineStrikeSpareOpen = new DetermineStrikeSpareOpen();

            frame = determineStrikeSpareOpen.CalculateFrameScore(frame);
            //then spare bool being false
            Assert.AreEqual(false, frame.wasSpare);
        }
コード例 #2
0
        public void Given_I_Have_a_frame_with_a_score_of_10_and_a_score_of_0_then_i_will_get_back_strike_bool_true()
        {
            //given i have a frame
            FrameObject frame;

            frame = new FrameObject {
                bowl1 = 10, bowl2 = 0, score = 10
            };
            //when the frame score is calculated
            IDetermineStrikeSpareOpen determineStrikeSpareOpen = new DetermineStrikeSpareOpen();

            frame = determineStrikeSpareOpen.CalculateFrameScore(frame);
            //then strike bool being true
            Assert.AreEqual(true, frame.wasStrike);
        }