Exemplo n.º 1
0
def test_strike_score_frame_next_zero_next():
    frames = [[10, 0], [1, 1], [0, 0]]  # 12, 2, 0x
    frames.append([0, 0] * 9)

    bowling_score = score(frames)

    assert 14 == bowling_score
Exemplo n.º 2
0
def test_spare_multiple_spares():
    frames = [[1, 9], [1, 9], [1, 9]]  # 11, 11, 10, 0x
    frames.append([0, 0] * 7)

    bowling_score = score(frames)

    assert 32 == bowling_score
Exemplo n.º 3
0
def test_strike_zero_frame_next():
    frames = [[10, 0]]  # 10, 0x
    frames.append([0, 0] * 9)

    bowling_score = score(frames)

    assert 10 == bowling_score
Exemplo n.º 4
0
def test_spare_not_zero_next():
    frames = [[1, 9], [1, 0]]  # 11, 1, 0x
    frames.append([0, 0] * 8)

    bowling_score = score(frames)

    assert 12 == bowling_score
Exemplo n.º 5
0
def test_spare_zero_next():
    frames = [[1, 9]]  # 10, 0x
    frames.append([0, 0] * 9)

    bowling_score = score(frames)

    assert 10 == bowling_score
Exemplo n.º 6
0
def test_score_one():
    frames = [[1, 0]]  # 1, 0x
    frames.append([0, 0] * 9)

    bowling_score = score(frames)

    assert 1 == bowling_score
Exemplo n.º 7
0
def test_tenth_frame_no_strike_no_spare():
    # 0, 0, 0, 0, 0, 0, 0, 0, 0, 9
    frames = [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0],
              [0, 0], [9, 0]]

    bowling_score = score(frames)

    assert 9 == bowling_score
Exemplo n.º 8
0
def test_ninth_frame_strike_zero_next():
    # 0, 0, 0, 0, 0, 0, 0, 0, 10, 0
    frames = [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0],
              [10, 0], [0, 0]]

    bowling_score = score(frames)

    assert 10 == bowling_score
Exemplo n.º 9
0
def test_three_strikes_in_a_row():
    # 30, 20, 10
    frames = [[10, 0], [10, 0], [10, 0], [0, 0], [0, 0], [0, 0], [0, 0],
              [0, 0], [0, 0], [0, 0]]

    bowling_score = score(frames)

    assert 60 == bowling_score
Exemplo n.º 10
0
def test_score_zeros():
    # 0x
    frames = [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0],
              [0, 0], [0, 0]]

    bowling_score = score(frames)

    assert 0 == bowling_score
Exemplo n.º 11
0
def test_strike_score_frame_next_score_next():
    # 22, 2, 10, 0x
    frames = [[10, 0], [1, 1], [1, 9], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0],
              [0, 0], [0, 0]]

    bowling_score = score(frames)

    assert 34 == bowling_score
Exemplo n.º 12
0
def test_tenth_frame_spare():
    # 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 1
    frames = [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0],
              [0, 0], [9, 1, 1]]

    bowling_score = score(frames)

    assert 12 == bowling_score
Exemplo n.º 13
0
def test_tenth_frame_strike():
    # 0, 0, 0, 0, 0, 0, 0, 0, 0, (12, 1, 1)
    frames = [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0],
              [0, 0], [10, 1, 1]]

    bowling_score = score(frames)

    assert 14 == bowling_score
Exemplo n.º 14
0
def test_strike_zero_frame_next():
    # 10, 0x
    frames = [[10, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0],
              [0, 0], [0, 0]]

    bowling_score = score(frames)

    assert 10 == bowling_score
Exemplo n.º 15
0
def test_spare_multiple_spares():
    # 11, 11, 10, 0x
    frames = [[1, 9], [1, 9], [1, 9], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0],
              [0, 0], [0, 0]]

    bowling_score = score(frames)

    assert 32 == bowling_score
Exemplo n.º 16
0
def test_all_spare_except_last_frame():
    # 11, 11, 11, 11, 11, 11, 11, 11, 10, 0
    frames = [[1, 9], [1, 9], [1, 9], [1, 9], [1, 9], [1, 9], [1, 9], [1, 9],
              [1, 9], [0, 0]]

    bowling_score = score(frames)

    assert 98 == bowling_score
Exemplo n.º 17
0
def test_spare_zero_next():
    # 10, 0x
    frames = [[1, 9], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0],
              [0, 0], [0, 0]]

    bowling_score = score(frames)

    assert 10 == bowling_score
Exemplo n.º 18
0
def test_spare_not_zero_next():
    # 11, 1, 0x
    frames = [[1, 9], [1, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0],
              [0, 0], [0, 0]]

    bowling_score = score(frames)

    assert 12 == bowling_score
Exemplo n.º 19
0
def test_ten_strikes():
    # 1-30, 2-30, 3-30, 4-30, 5-30, 6-30, 7-30, 8-30, 9-20, 10-10
    frames = [[10, 0], [10, 0], [10, 0], [10, 0], [10, 0], [10, 0], [10, 0],
              [10, 0], [10, 0], [10, 0, 0]]

    bowling_score = score(frames)

    assert 270 == bowling_score
Exemplo n.º 20
0
def test_scores_no_strike_no_spare():
    # 9, 9, 9, 9, 9, 9, 9, 9, 9, 9
    frames = [[5, 4], [5, 4], [5, 4], [5, 4], [5, 4], [5, 4], [5, 4], [5, 4],
              [5, 4], [5, 4]]

    bowling_score = score(frames)

    assert 90 == bowling_score
Exemplo n.º 21
0
def test_nine_strikes():
    # 1-30, 2-30, 3-30, 4-30, 5-30, 6-30, 7-30, 8-20, 9-10, 10-0
    frames = [[10, 0], [10, 0], [10, 0], [10, 0], [10, 0], [10, 0], [10, 0],
              [10, 0], [10, 0], [0, 0]]

    bowling_score = score(frames)

    assert 240 == bowling_score
Exemplo n.º 22
0
def test_eight_strikes():
    # 1-30, 2-30, 3-30, 4-30, 5-30, 6-30, 7-20, 8-10, 9-0, 10-0
    frames = [[10, 0], [10, 0], [10, 0], [10, 0], [10, 0], [10, 0], [10, 0],
              [10, 0], [0, 0], [0, 0]]

    bowling_score = score(frames)

    assert 210 == bowling_score
Exemplo n.º 23
0
def test_tenth_frame_strik_strike_strike():
    # 0, 0, 0, 0, 0, 0, 0, 0, 0, (30, 20, 10)
    frames = [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0],
              [0, 0], [10, 10, 10]]

    bowling_score = score(frames)

    assert 60 == bowling_score
Exemplo n.º 24
0
def test_tenth_frame_strik_strike_zero():
    # 0, 0, 0, 0, 0, 0, 0, 0, 0, (20, 10, 0)
    frames = [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0],
              [0, 0], [10, 10, 0]]

    bowling_score = score(frames)

    assert 30 == bowling_score
Exemplo n.º 25
0
def test_tenth_frame_strike_spare():
    # 0, 0, 0, 0, 0, 0, 0, 0, 0, (20, 9, 1)
    frames = [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0],
              [0, 0], [10, 9, 1]]

    bowling_score = score(frames)

    assert 30 == bowling_score
Exemplo n.º 26
0
def test_score_one():
    # 1, 0x
    frames = [
        [1, 0],
        [0, 0],
        [0, 0],
        [0, 0],
        [0, 0],
        [0, 0],
        [0, 0],
        [0, 0],
        [0, 0],
        [0, 0],
    ]

    bowling_score = score(frames)

    assert 1 == bowling_score
Exemplo n.º 27
0
def test_score_zeros():
    frames = [[0, 0] * 10]  # 0x

    bowling_score = score(frames)

    assert 0 == bowling_score
Exemplo n.º 28
0
def test_scores_no_strike_no_spare():
    frames = [[5, 4] * 10]  # 9, 9, 9, 9, 9, 9, 9, 9, 9, 9

    bowling_score = score(frames)

    assert 90 == bowling_score