public void StrikeHappen()
 {
     Game g = new Game();
     g.SetRounds(10,0);
     g.SetRounds(4,3);
     Assert.That(g.GetFinalScore(),Is.EqualTo(24));
 }
 public void SpareHappen()
 {
     Game g = new Game();
     g.SetRounds(5, 5);
     g.SetRounds(4,3);
     Assert.That(g.GetFinalScore(), Is.EqualTo(21));
 }
Esempio n. 3
0
 public void FirstRound()
 {
     Game g = new Game();
     g.SetPins(5);
     g.SetPins(4);
     Assert.That(g.GetFinalScore(), Is.EqualTo(9));
 }
 public void DoubleStrike()
 {
     Game g = new Game();
     g.SetRounds(10, 0);
     g.SetRounds(10, 0);
     g.SetRounds(4,3);
     Assert.That(g.GetFinalScore(),Is.EqualTo(48));
 }
 public void NoSpareNoStrike()
 {
     Game g = new Game();
     for(int i=0;i<10;i++)
     {
         g.SetRounds(2,2);
     }
     Assert.That(g.GetFinalScore(), Is.EqualTo(40));
 }
Esempio n. 6
0
 public void InvalidInput()
 {
     Game g = new Game();
     for (int i = 0; i < 20; i++)
     {
         g.SetPins(-1);
     }
     Assert.That(g.GetFinalScore(), Is.EqualTo(0));
 }
Esempio n. 7
0
 public void AllZero()
 {
     Game g = new Game();
     for (int i = 0; i < 20; i++)
     {
         g.SetPins(0);
     }
     Assert.That(g.GetFinalScore(), Is.EqualTo(0));
 }
Esempio n. 8
0
 public void Normal()
 {
     Game g = new Game();
     for (int i = 0; i < 20; i++)
     {
         g.SetPins(4);
     }
     Assert.That(g.GetFinalScore(), Is.EqualTo(80));
 }
Esempio n. 9
0
 public void TripleRound()
 {
     Game g = new Game();
     g.SetPins(1);
     g.SetPins(4);
     g.SetPins(4);
     g.SetPins(5);
     g.SetPins(3);
     Assert.That(g.GetFinalScore(), Is.EqualTo(37));
 }
Esempio n. 10
0
 public void FirstBall()
 {
     Game g = new Game();
     g.SetPins(5);
     for (int i = 0; i < 19; i++)
     {
         g.SetPins(0);
     }
     Assert.That(g.GetFinalScore(), Is.EqualTo(5));
 }
Esempio n. 11
0
        public void TestGetFinalScore()
        {
            Game g = new Game();
               for (int i = 0; i < 20; i += 2)
               {
                    g.SetPins(10);
               }

               Assert.That(g.GetFinalScore(), Is.EqualTo(100));
        }
 public void oneStrike()
 {
     Game g = new Game();
     for (int i = 0; i < 20;i++ )
     {
         if (i == 10){ g.SetPins(10,i);
             i+=1;}
         else g.SetPins(1,i);
     }
      Assert.That(g.GetFinalScore(), Is.EqualTo(30));
 }
Esempio n. 13
0
 public void has1StrikeAndValue()
 {
     Game g = new Game();
     g.SetPins(10);
     g.SetPins(4);
     g.SetPins(4);
     for (int i = 0; i < 16; i++)
     {
         g.SetPins(0);
     }
     Assert.That(g.GetFinalScore(), Is.EqualTo(26));
 }
Esempio n. 14
0
 public void ASpair()
 {
     Game g = new Game();
     g.SetPins(5);
     g.SetPins(5);
     g.SetPins(5);
     for (int i = 0; i < 17; i++)
     {
         g.SetPins(0);
     }
     Assert.That(g.GetFinalScore(), Is.EqualTo(20));
 }
Esempio n. 15
0
 public void FinalSpairCase()
 {
     Game g = new Game();
     for(int i=0;i<18;i+=1)
     {
         g.SetPins(0);
     }
     g.SetPins(0);
     g.SetPins(10);
     g.SetPins(5);
     Assert.That(g.GetFinalScore(), Is.EqualTo(15));
 }
Esempio n. 16
0
 public void Strike3()
 {
     Game g = new Game();
        for (int i = 0; i < 18; i += 2)
        {
             g.SetPins(10);
        }
        g.SetPins(5);
        g.SetPins(0);
        g.SetPins(10);
        Assert.That(g.GetFinalScore(), Is.EqualTo(95));
 }
Esempio n. 17
0
        public void TestScore()
        {
            Game g = new Game();
               for (int i = 0; i < 20; i += 2)
               {
                    g.SetPins(10);
               }
               Assert.That(g.GetScore(0), Is.EqualTo(10));
               Assert.That(g.GetScore(1), Is.EqualTo(0));

               Assert.That(g.GetScore(18), Is.EqualTo(10));
               Assert.That(g.GetScore(19), Is.EqualTo(0));
        }
Esempio n. 18
0
 public void has2Spares()
 {
     Game g = new Game();
     g.SetPins(6);
     g.SetPins(4);
     g.SetPins(4);
     g.SetPins(6);
     g.SetPins(6);
     for (int i = 0; i < 15; i++)
     {
         g.SetPins(0);
     }
     Assert.That(g.GetFinalScore(), Is.EqualTo(36));
 }
Esempio n. 19
0
        public void Strike()
        {
            Game g = new Game();
            g.SetPins(10);
            g.SetPins(5);
            g.SetPins(0);
            Assert.That(g.GetFinalScore(), Is.EqualTo(20));

            Game gg = new Game();
            for (int i = 0; i < 12; i++)
            {
                gg.SetPins(10);
            }
            Assert.That(gg.GetFinalScore(), Is.EqualTo(300));
        }
 public void HaveStrikeAndSpareNormal()
 {
     Game g = new Game();
     g.SetPins(6);
     g.SetPins(4);
     g.SetPins(5);
     g.SetPins(5);
     g.SetPins(10);
     g.SetPins(0);
     g.SetPins(7);
     g.SetPins(3);
     for (int i = 8; i < 20; i++)
     {
         g.SetPins(0);
     }
     Assert.That(g.GetFinalScore(), Is.EqualTo(65));
 }
Esempio n. 21
0
 public void multiSpare()
 {
     Game g = new Game();
     for (int i = 0; i < 20; i++)
     {
         if (i == 4)
             g.SetPins(3);
         else if (i == 5)
             g.SetPins(7);
         else if (i == 8)
             g.SetPins(6);
         else if (i == 9)
             g.SetPins(4);
         else
             g.SetPins(1);
     }
     Assert.That(g.GetFinalScore(), Is.EqualTo(38));
 }
 public void HaveSpareSpecial()
 {
     Game g = new Game();
     g.SetPins(6);
     g.SetPins(4);
     g.SetPins(5);
     g.SetPins(1);
     g.SetPins(5);
     g.SetPins(5);
     g.SetPins(7);
     g.SetPins(3);
     for (int i = 8; i < 18; i++)
     {
         g.SetPins(0);
     }
     g.SetPins(3);
     g.SetPins(7);
     g.SetPins(3);
     Assert.That(g.GetFinalScore(), Is.EqualTo(61));
 }
 public void StrikeCombo()
 {
     Game g = new Game();
     for (int i = 0; i < 20; i++)
     {
         if (i == 10)
         {
             g.SetPins(10, i);
             i += 1;
             g.SetPins(0, i);
         }
         else if (i == 12)
         {
             g.SetPins(10, i);
             i += 1;
             g.SetPins(0, i);
         }
         else g.SetPins(1, i);
     }
     Assert.That(g.GetFinalScore(), Is.EqualTo(49));
 }
Esempio n. 24
0
        public void Spare()
        {
            Game g = new Game();
            g.SetPins(5);
            g.SetPins(5);
            g.SetPins(5);
            g.SetPins(4);
            Assert.That(g.GetFinalScore(), Is.EqualTo(24));

            Game gg = new Game();
            for (int i = 0; i < 9; i++)
            {
                gg.SetPins(0);
                gg.SetPins(10);
            }
            gg.SetPins(5);
            gg.SetPins(5);
            gg.SetPins(10);

            Assert.That(gg.GetFinalScore(), Is.EqualTo(115));
        }
Esempio n. 25
0
 public void ContiStrike()
 {
     Game g = new Game();
     for (int i = 0; i < 20; i++)
     {
         if (i == 4)
             g.SetPins(0);
         else if (i == 5)
             g.SetPins(10);
         else if (i == 6)
             g.SetPins(0);
         else if (i == 7)
             g.SetPins(10);
         else if (i == 8)
             g.SetPins(0);
         else if (i == 9)
             g.SetPins(10);
         else
             g.SetPins(1);
     }
     Assert.That(g.GetFinalScore(), Is.EqualTo(77));
 }
Esempio n. 26
0
 public void Ptt()
 {
     Game g = new Game();
     g.SetPins(1);
     g.SetPins(4);
     g.SetPins(4);
     g.SetPins(5);
     g.SetPins(6);
     g.SetPins(4);
     g.SetPins(5);
     g.SetPins(5);
     g.SetPins(10);
     g.SetPins(0);
     g.SetPins(1);
     g.SetPins(7);
     g.SetPins(3);
     g.SetPins(6);
     g.SetPins(4);
     g.SetPins(10);
     g.SetPins(2);
     g.SetPins(8);
     g.SetPins(6);
     Assert.That(g.GetFinalScore(), Is.EqualTo(133));
 }
Esempio n. 27
0
 public void hasOneStrike()
 {
     Game g = new Game();
     g.SetPins(10);
     for (int i = 0; i < 18; i++)
     {
         g.SetPins(0);
     }
     Assert.That(g.GetFinalScore(), Is.EqualTo(10));
 }
 public void twoSpare()
 {
     Game g = new Game();
     for (int i = 0; i < 20; i++)
     {
         if (i == 10)
         {
             g.SetPins(9, i);
             i += 1;
             g.SetPins(1, i);
         }
         if (i == 12)
         {
             g.SetPins(5, i);
             i += 1;
             g.SetPins(5, i);
         }
         else g.SetPins(1, i);
     }
     Assert.That(g.GetFinalScore(), Is.EqualTo(42));
 }
Esempio n. 29
0
 public void haslastSpares()
 {
     Game g = new Game();
     g.SetPins(6);
     g.SetPins(4);
     g.SetPins(4);
     g.SetPins(6);
     g.SetPins(6);
     for (int i = 0; i < 13; i++)
     {
         g.SetPins(0);
     }
     g.SetPins(2);
     g.SetPins(8);
     g.SetPins(6);
     Assert.That(g.GetFinalScore(), Is.EqualTo(52));
 }
Esempio n. 30
0
        public void StrikeSpare()
        {
            Game gg = new Game();
            for (int i = 0; i < 5; i++)
            {
                gg.SetPins(10);

                gg.SetPins(0);
                gg.SetPins(10);
            }
            gg.SetPins(10);

            Assert.That(gg.GetFinalScore(), Is.EqualTo(200));
        }