예제 #1
0
def when_score_is_forty_love_and_p1_score_then_game_is_over_test():
  tennis = TennisGame(Score.FORTY, Score.LOVE)
  tennis.score_player(1)
  assert tennis.is_over 
예제 #2
0
def when_score_is_forty_all_and_p1_score_then_game_is_not_over_test():
  tennis = TennisGame(Score.FORTY, Score.FORTY)
  tennis.score_player(1)
  assert not tennis.is_over
예제 #3
0
def when_score_is_thirty_love_and_p1_score_then_game_is_not_over_test():
  tennis = TennisGame(Score.THIRTY, Score.LOVE)
  tennis.score_player(1)
  assert not tennis.is_over
예제 #4
0
def when_score_is_love_forty_and_p2_score_then_game_is_over_test():
  tennis = TennisGame(Score.LOVE, Score.FORTY)
  tennis.score_player(2)
  assert tennis.is_over
예제 #5
0
def when_score_is_love_all_and_p1_score_then_score_is_fifteen_love_test():
  tennis = TennisGame()
  tennis.score_player(1)
  assert tennis.score == (Score.FIFTEEN, Score.LOVE)
예제 #6
0
def when_score_is_forty_love_and_p1_score_then_game_is_over_test():
    tennis = TennisGame(Score.FORTY, Score.LOVE)
    tennis.score_player(1)
    assert tennis.is_over
예제 #7
0
def when_score_is_love_all_and_p1_score_then_game_is_not_over_test():
  tennis = TennisGame()
  tennis.score_player(1)
  assert not tennis.is_over
예제 #8
0
def when_score_is_thirty_love_and_p1_score_then_game_is_not_over_test():
    tennis = TennisGame(Score.THIRTY, Score.LOVE)
    tennis.score_player(1)
    assert not tennis.is_over
예제 #9
0
def when_score_is_forty_all_and_p1_score_then_game_is_not_over_test():
    tennis = TennisGame(Score.FORTY, Score.FORTY)
    tennis.score_player(1)
    assert not tennis.is_over
예제 #10
0
def when_score_is_love_all_and_p1_score_then_score_is_fifteen_love_test():
    tennis = TennisGame()
    tennis.score_player(1)
    assert tennis.score == (Score.FIFTEEN, Score.LOVE)
예제 #11
0
def when_score_is_love_forty_and_p2_score_then_game_is_over_test():
    tennis = TennisGame(Score.LOVE, Score.FORTY)
    tennis.score_player(2)
    assert tennis.is_over
예제 #12
0
def when_score_is_love_all_and_p1_score_then_game_is_not_over_test():
    tennis = TennisGame()
    tennis.score_player(1)
    assert not tennis.is_over