Ejemplo n.º 1
0
        public void testStrikeSpare()
        {
            List <frame> frameList = new List <frame>()
            {
                new frame(10, 0),
                new frame(0, 10),
                new frame(10, 0),
                new frame(10, 0)
            };
            GameScorer scorer = new GameScorer(frameList);

            Assert.Equal(20, scorer.scoreFrame(0));
            Assert.Equal(20, scorer.scoreFrame(1));
        }
Ejemplo n.º 2
0
        public void testSplit()
        {
            List <frame> frameList = new List <frame>()
            {
                new frame(0, 10),
                new frame(2, 2),
                new frame(3, 7),
                new frame(6, 4)
            };
            GameScorer scorer = new GameScorer(frameList);

            Assert.Equal(12, scorer.scoreFrame(0));
            Assert.Equal(16, scorer.scoreFrame(2));
        }
Ejemplo n.º 3
0
        public void testStrike()
        {
            List <frame> frameList = new List <frame>()
            {
                new frame(10, 0),
                new frame(10, 0),
                new frame(10, 0),
                new frame(1, 1)
            };
            GameScorer scorer = new GameScorer(frameList);

            Assert.Equal(30, scorer.scoreFrame(0));
            Assert.Equal(12, scorer.scoreFrame(2));
        }
Ejemplo n.º 4
0
        public void testBasicFrameScores(int roll1, int roll2, int expected)
        {
            List <frame> frameList = new List <frame>()
            {
                new frame(roll1, roll2)
            };
            GameScorer scorer = new GameScorer(frameList);

            Assert.Equal(expected, scorer.scoreFrame(0));
        }