Created
February 25, 2016 10:42
-
-
Save HelloThisIsFlo/ffd394507f845767fddf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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