示例#1
0
    def test_with_given_empty_game_should_return_correct_frames_list(self):
        total_shots = []

        frames = BowlingGame.find_frames(total_shots)
        expected = []

        self.assertEqual(frames, expected)
示例#2
0
    def test_with_given_game_should_return_correct_frames_list(self):
        total_shots = [
            1, 4, 4, 5, 6, 3, 5, 1, 1, 0, 1, 7, 3, 6, 4, 3, 2, 1, 6, 2
        ]

        frames = BowlingGame.find_frames(total_shots)
        expected = [
            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((6, 2))
        ]

        self.assertEqual(frames, expected)