Beispiel #1
0
    def test_with_given_less_than_10_frames_should_return_false(self):
        frames = [
            Frame((1, 4)),
            Frame((4, 5)),
            Frame((6, 3)),
            Frame((5, 1)),
            Frame((1, 0)),
            Frame((1, 7)),
            Frame((3, 6)),
            Frame((4, 3)),
            Frame((2, 1))
        ]

        result = BowlingGame.validate_frames(frames)

        self.assertEqual(result, False)
Beispiel #2
0
    def test_with_given_10_frames_and_tenth_is_with_two_shots_and_stike_in_them_should_return_false(
            self):
        frames = [
            Frame((1, 4)),
            Frame((4, 5)),
            Frame((6, 3)),
            Frame((5, 1)),
            Frame((1, 0)),
            Frame((1, 7)),
            Frame((3, 6)),
            Frame((4, 3)),
            Frame((2, 1)),
            Frame((10, 2))
        ]

        result = BowlingGame.validate_frames(frames)

        self.assertEqual(result, False)
Beispiel #3
0
    def test_with_given_10_frames_and_tenth_is_with_three_shots_and_a_spare_in_them_should_return_true(
            self):
        frames = [
            Frame((1, 4)),
            Frame((4, 5)),
            Frame((6, 3)),
            Frame((5, 1)),
            Frame((1, 0)),
            Frame((1, 7)),
            Frame((3, 6)),
            Frame((4, 3)),
            Frame((2, 1)),
            Frame((1, 9, 10))
        ]

        result = BowlingGame.validate_frames(frames)

        self.assertEqual(result, True)