def test_turn_score_is_zero_on_roll_of_one(): player = Player() turn = Turn(player) turn.score = 10 turn.record_roll(1) assert turn.score == 0
def test_turn_tells_player_roll(): # This should result in a roll of 4. random.seed(0) player = TestPlayer() turn = Turn(player) turn.go() assert player.rolls == [4]
def test_turn_repeats_until_player_stops(): # This should result in a rolls of [2, 4, 4]. random.seed(100) player = StopAtThreePlayer() turn = Turn(player) turn.start() assert turn.over assert turn.player.rolls == [2, 4, 4]
def test_turn_ends_on_a_roll_of_one(): player = Player() turn = Turn(player) assert not turn.over turn.record_roll(1) assert turn.over
def test_turn_collect_rolls(): player = Player() turn = Turn(player) assert turn.score == 0 turn.record_roll(3) assert turn.score == 3 turn.record_roll(5) assert turn.score == 8