Play() public method

public Play ( int firstBall, int secondBall, int thirdBall = -1 ) : void
firstBall int
secondBall int
thirdBall int
return void
Esempio n. 1
0
        public void ScoreBoardShouldCountScoreOfPerfectGame()
        {
            //given
            var scoreBoard = new ScoreBoard();

            //when
            scoreBoard.Play(10, 0);
            scoreBoard.Play(10, 0);
            scoreBoard.Play(10, 0);
            scoreBoard.Play(10, 0);
            scoreBoard.Play(10, 0);
            scoreBoard.Play(10, 0);
            scoreBoard.Play(10, 0);
            scoreBoard.Play(10, 0);
            scoreBoard.Play(10, 0);
            scoreBoard.Play(10, 10, 10);

            //then
            Assert.AreEqual(300, scoreBoard.TotalScore);
        }
Esempio n. 2
0
        public void ScoreBoardShouldCountScoreWhenLastFrameHasStrike()
        {
            //given
            var scoreBoard = new ScoreBoard();

            //when
            scoreBoard.Play(1, 2); //3
            scoreBoard.Play(2, 8); //20
            scoreBoard.Play(10, 0); //19
            scoreBoard.Play(4, 5); //9
            scoreBoard.Play(7, 3); //11
            scoreBoard.Play(1, 2); //3
            scoreBoard.Play(10, 0); //13
            scoreBoard.Play(1, 2); //3
            scoreBoard.Play(5, 2); //7
            scoreBoard.Play(10, 9, 3); //22

            //then
            Assert.AreEqual(110, scoreBoard.TotalScore);
        }
Esempio n. 3
0
        public void ScoreBoardShouldCountScoreOfNormalGame()
        {
            //given
            var scoreBoard = new ScoreBoard();

            //when
            scoreBoard.Play(1, 2); //3
            scoreBoard.Play(2, 8); //20
            scoreBoard.Play(10, 0); //19
            scoreBoard.Play(4, 5); //9
            scoreBoard.Play(7, 3); //11
            scoreBoard.Play(1, 2); //3
            scoreBoard.Play(10, 0); //13
            scoreBoard.Play(1, 2); //3
            scoreBoard.Play(5, 2); //7
            scoreBoard.Play(1, 2); //3

            //then
            Assert.AreEqual(91, scoreBoard.TotalScore);
        }