public void FirstRound() { Game g = new Game(); g.SetPins(5); g.SetPins(4); Assert.That(g.GetFinalScore(), Is.EqualTo(9)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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 Normal() { Game g = new Game(); for (int i = 0; i < 20; i++) { g.SetPins(4); } Assert.That(g.GetFinalScore(), Is.EqualTo(80)); }
public void InvalidInput() { Game g = new Game(); for (int i = 0; i < 20; i++) { g.SetPins(-1); } Assert.That(g.GetFinalScore(), Is.EqualTo(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)); }
public void ContiSpare() { 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 == 6) g.SetPins(6); else if (i == 7) g.SetPins(4); else g.SetPins(1); } Assert.That(g.GetFinalScore(), Is.EqualTo(43)); }
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 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)); }
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)); }
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)); }
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)); }
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)); }
public void Test1() { Game g = new Game(); g.SetPins(0); g.SetPins(10); g.SetPins(9); g.SetPins(1); g.SetPins(0); g.SetPins(10); g.SetPins(7); g.SetPins(3); g.SetPins(0); g.SetPins(10); g.SetPins(2); g.SetPins(8); g.SetPins(0); g.SetPins(10); g.SetPins(5); g.SetPins(5); g.SetPins(0); g.SetPins(10); g.SetPins(1); g.SetPins(9); g.SetPins(10); Assert.That(g.GetFinalScore(), Is.EqualTo(200)); }
public void NoSpareOrStrike() { Game g = new Game(); for (int i = 0; i < 10; i++) { g.SetPins(2); } for (int i = 10; i < 20; i++) { g.SetPins(3); } Assert.That(g.GetFinalScore(), Is.EqualTo(50)); }
public void StrikeSpair() { Game g = new Game(); g.SetPins(10); g.SetPins(3); g.SetPins(7); g.SetPins(5); g.SetPins(0); for (int i = 0; i < 14; i++) { g.SetPins(0); } Assert.That(g.GetFinalScore(), Is.EqualTo(40)); }
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 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)); }
public void Test2() { Game g = new Game(); g.SetPins(0); g.SetPins(10); g.SetPins(0); g.SetPins(10); g.SetPins(0); g.SetPins(10); g.SetPins(0); g.SetPins(10); g.SetPins(0); g.SetPins(10); g.SetPins(0); g.SetPins(10); g.SetPins(0); g.SetPins(10); g.SetPins(0); g.SetPins(10); g.SetPins(0); g.SetPins(10); g.SetPins(10); g.SetPins(10); g.SetPins(10); Assert.That(g.GetFinalScore(), Is.EqualTo(300)); }
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)); }
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)); }
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)); }
public void StrikeContinueSpecial() { Game g = new Game(); g.SetPins(10); g.SetPins(0); g.SetPins(10); g.SetPins(0); g.SetPins(5); g.SetPins(5); for (int i = 6; i < 20; i++) { g.SetPins(0); } Assert.That(g.GetFinalScore(), Is.EqualTo(55)); }
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)); }