示例#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