Пример #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