Skip to content

Instantly share code, notes, and snippets.

@HelloThisIsFlo
Created February 25, 2016 10:42
Show Gist options
  • Save HelloThisIsFlo/ffd394507f845767fddf to your computer and use it in GitHub Desktop.
Save HelloThisIsFlo/ffd394507f845767fddf to your computer and use it in GitHub Desktop.
class ScoreCounter:
def __init__(self):
self.pins_down = None
def roll(self, pins_down):
self.pins_down = pins_down
def score(self):
return self.pins_down
def test_if_zero_pin_down_score_zero():
score_counter = ScoreCounter()
score_counter.roll(0)
score = score_counter.score()
assert (0 == score)
def test_single_shot_returns_number_pin_down():
score_counter = ScoreCounter()
score_counter.roll(4)
score = score_counter.score()
assert (4 == score)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment