def test_too_many_fetches(self): score = BowlingScore() for i in range(10): score.add_frame((1, 1)) self.assertRaises(TooManyFramesError, score.add_frame, (1, 1))
def test_too_few_tries(self): score = BowlingScore() self.assertRaises(WrongTriesInFrame, score.add_frame, (1,))
def test_big_total(self): score = BowlingScore() self.assertRaises(TooBigPinError, score.add_frame, (7, 7))
def test_fractional(self): score = BowlingScore() self.assertRaises(NotIntegerPinError, score.add_frame, (0.5, 2))
def test_negative(self): score = BowlingScore() self.assertRaises(NegativePinError, score.add_frame, (-1, 2))
def pins_vs_totals(self, pins, totals): score = BowlingScore() score.add_all_frames(pins) score.calculate_all_totals() self.assertEquals(score.get_totals(), totals)