Beispiel #1
0
    def test_with_empty_list_raise_error(self):
        exc = None

        try:
            BowlingGame.validate([])
        except Exception as err:
            exc = err

        self.assertIsNotNone(str(exc))
        self.assertEqual(str(exc), 'Invalid number of frames')
Beispiel #2
0
    def test_with_invalid_numbers_of_frames_raise_error(self):
        exc = None

        try:
            BowlingGame.validate([5, 1, 1, 0, 1, 7, 3, 6, 4, 3, 2, 1, 6])
        except Exception as err:
            exc = err

        self.assertIsNotNone(str(exc))
        self.assertEqual(str(exc), 'Invalid number of frames')
Beispiel #3
0
    def test_with_invalid_numbers_of_frames_with_strike_not_in_the_tenth_frame_raise_error(
            self):
        exc = None

        try:
            BowlingGame.validate(
                [5, 1, 10, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1])
        except Exception as err:
            exc = err

        self.assertIsNotNone(str(exc))
        self.assertEqual(str(exc), 'Invalid number of frames')