예제 #1
0
        public void TestBownling271()
        {
            int    shouldBeValue  = 271;
            string shouldBeString = "X,X,X,X,X,X,X,X,X,1/X";

            Bowling game = new Bowling();

            game.AddStrike().AddStrike().AddStrike().AddStrike().AddStrike().AddStrike().AddStrike().AddStrike().AddStrike().AddFrameExtra(1, 9, 10);

            int score = game.CalculateScore();

            Assert.AreEqual <int>(shouldBeValue, score);

            string visual = game.ToString();

            Assert.AreEqual <string>(shouldBeString, visual);
        }
예제 #2
0
        public void TestBownling10AsStrike()
        {
            int    shouldBeValue  = 10;
            string shouldBeString = "X";

            Bowling game = new Bowling();

            game.AddStrike();

            int score = game.CalculateScore();

            Assert.AreEqual <int>(shouldBeValue, score);

            string visual = game.ToString();

            Assert.AreEqual <string>(shouldBeString, visual);
        }