コード例 #1
0
def test_three_pairs():
    actual, _ = GameLogic.calculate_score((
        2,
        2,
        4,
        4,
        3,
        3,
    ), [1])
    expected = 1500
    assert actual == expected
コード例 #2
0
def test_six_of_a_kind():
    actual, _ = GameLogic.calculate_score((2, 2, 2, 2, 2, 2), [1])
    expected = 800
    assert actual == expected
コード例 #3
0
def test_straight():
    actual, _ = GameLogic.calculate_score((1, 6, 3, 2, 5, 4), [1])
    expected = 1500
    assert actual == expected
コード例 #4
0
def test_three_ones_and_a_five():
    actual, _ = GameLogic.calculate_score((1, 1, 1, 5), [1])
    expected = 1050
    assert actual == expected
コード例 #5
0
def test_three_ones():
    actual, _ = GameLogic.calculate_score((1, 1, 1, 2, 3, 4), [1])
    expected = 1000
    assert actual == expected
コード例 #6
0
def test_roll_dice():
    game = GameLogic()
    actual = len(game.roll_dice(6))
    expected = 6
    assert actual == expected
コード例 #7
0
def test_three_fives():
    actual, _ = GameLogic.calculate_score((5, 5, 5, 2, 2, 3), [1])
    expected = 500
    assert actual == expected
コード例 #8
0
def test_zilch():
    actual, _ = GameLogic.calculate_score((2, ), [1])
    expected = 0
    assert actual == expected
コード例 #9
0
def test_one_and_five():
    actual, _ = GameLogic.calculate_score((1, 5), [1])
    expected = 150
    assert actual == expected
コード例 #10
0
def test_two_ones():
    actual, _ = GameLogic.calculate_score((1, 1), [1])
    expected = 200
    assert actual == expected
コード例 #11
0
def test_two_fives():
    actual, _ = GameLogic.calculate_score((5, 5, 6), [1])
    expected = 100
    assert actual == expected
コード例 #12
0
def test_single_five():
    actual, _ = GameLogic.calculate_score((5, ), [1])
    expected = 50
    assert actual == expected
コード例 #13
0
def test_single_one():
    actual, _ = GameLogic.calculate_score((1, ), [1])
    expected = 100
    assert actual == expected
コード例 #14
0
def test_all(test_input, expected):
    actual, _ = GameLogic.calculate_score(test_input, [1])
    assert actual == expected
コード例 #15
0
def test_roll_dice_low():
    game = GameLogic()
    actual = len(game.roll_dice(2))
    expected = 2
    assert actual == expected