Esempio n. 1
0
def test_game_final_set(scores: List[int], expected_total):
    bowling_scorer = BowlingScorer()
    for score in scores:
        bowling_scorer.add_try(score)
        print(bowling_scorer.previous_try.frame_score)

    assert bowling_scorer.total_score == expected_total
Esempio n. 2
0
def test_bowling_spare_then_strike_then_strike(scores: List[int],
                                               expected_total):
    bowling_scorer = BowlingScorer()
    for score in scores:
        bowling_scorer.add_try(score)
        print(bowling_scorer.total_score)
        print(bowling_scorer.previous_try.is_spare)

    assert bowling_scorer.total_score == expected_total
Esempio n. 3
0
def test_bowling_score_first_strike_then_less_than_ten(score: int,
                                                       second_score: int):
    bowling_scorer = BowlingScorer()
    bowling_scorer.add_try(score)
    print(bowling_scorer.total_score)
    bowling_scorer.add_try(second_score)
    print(bowling_scorer.total_score)
    print(bowling_scorer.frames)
    assert bowling_scorer.total_score == score + second_score * 2
Esempio n. 4
0
def test_bowling_score_first_spare_then_less_than_ten(scores: List[int]):
    bowling_scorer = BowlingScorer()
    for score in scores:
        bowling_scorer.add_try(score)
        print(bowling_scorer.total_score)
    assert bowling_scorer.total_score == 12
Esempio n. 5
0
def test_second_try(score: int, second_score: int):
    bowling_scorer = BowlingScorer()
    bowling_scorer.add_try(score)
    bowling_scorer.add_try(second_score)
    assert bowling_scorer.total_score == 10
Esempio n. 6
0
def test_first_try(score):
    bowling_scorer = BowlingScorer()
    bowling_scorer.add_try(score)
    assert bowling_scorer.total_score == score