Example #1
0
def test_lottery_same():
    """
    Test lottery.

    :return:
    """
    for num in range(6, 100000):
        assert lottery(num, num, num) == 5
    for num in range(-100000, 5):
        assert lottery(num, num, num) == 5
Example #2
0
def test_lottery_different():
    """
    Test lottery.

    :return:
    """
    for num in range(-100000, 100000):
        assert lottery(num, num, not num) == 0
        assert lottery(num, not num, num) == 0
        assert lottery(num, not num, not num) == 1
Example #3
0
def test_lottery_small_win():
    """Test when b and c are different from a in lottery."""
    for a in range(0, 10):
        for b in range(0, 10):
            for c in range(0, 10):
                if a != b and a != c:
                    assert solution.lottery(a, b, c) == 1
Example #4
0
def test_lottery_lose():
    """Test when b or c equals a in lottery."""
    for a in range(0, 10):
        for b in range(0, 10):
            for c in range(0, 10):
                if (a == b or a == c) and b != c:
                    assert solution.lottery(a, b, c) == 0
Example #5
0
def test_lottery():
    """
    Test lottery.

    :return:
    """
    assert lottery(5, 5, 5) == 10
    assert lottery(2, 3, 1) == 1
    assert lottery(1, 2, 3) == 1
    assert lottery(-1, -2, -3) == 1
    assert lottery(10, 56, -9) == 1
    assert lottery(99, 98, 97) == 1
    assert lottery(9999, 9998, 9997) == 1
Example #6
0
def test_lottery_all_same_numbers():
    """Test if all lottery numbers are same."""
    assert solution.lottery(4, 4, 4) == 5
    assert solution.lottery(-5, -5, -5) == 5
    assert solution.lottery(0, 0, 0) == 5
Example #7
0
def test_lottery_a_is_c():  # test 18
    """A is B or A is C."""
    assert solution.lottery(7, 2, 7) == 0
Example #8
0
def test_lottery_all_5():
    """Test if all lottery numbers are 5."""
    assert solution.lottery(5, 5, 5) == 10
Example #9
0
def test_lottery_all_zero():  # test 16
    """All equal 0."""
    assert solution.lottery(0, 0, 0) == 5
Example #10
0
def test_lottery_a_is_b():  # test 17
    """A is B or A is C."""
    assert solution.lottery(6, 6, 2) == 0
Example #11
0
def test_lottery_all_equal_not_5():  # test 14
    """All equal not 5."""
    assert solution.lottery(4, 4, 4) == 5
Example #12
0
def test_lottery_all_equal_neg():  # test 15
    """All equal negative."""
    assert solution.lottery(-5, -5, -5) == 5
Example #13
0
def test_lottery_a_not_b_and_a_not_c():  # test 20
    """A not B and A not C."""
    assert solution.lottery(4, 2, 1) == 1
Example #14
0
def test_lottery_all_equal_5():  # test 13
    """All equal 5."""
    assert solution.lottery(5, 5, 5) == 10
Example #15
0
def test_lottery_b_c_different_a():
    """Test if b and c are not equal to a."""
    assert solution.lottery(1, 5, 5) == 1
    assert solution.lottery(1, 5, 3) == 1
Example #16
0
def test_lottery_1():
    """Should return 10, since all of the numbers are 5."""
    assert lottery(5, 5, 5) == 10
Example #17
0
def test_lottery_2():
    """Should return 5, since all of the numbers are equal, but not 5."""
    assert lottery(4, 4, 4) == lottery(-5, -5, -5) == lottery(0, 0, 0) == 5
Example #18
0
def test_lottery_win():
    """Test when all three numbers are the same but not five in lottery."""
    for i in range(0, 10):
        num = i
        if num != 5:
            assert solution.lottery(num, num, num) == 5
Example #19
0
def test_lottery_jackpot():
    """Test when all three numbers are five in lottery."""
    assert solution.lottery(5, 5, 5) == 10
Example #20
0
def test_lottery_4():
    """Should return 0, since either b or c is equal to a."""
    assert lottery(1, 1, 3) == lottery(-1, -1, -3) == lottery(1, 3, 1) == lottery(-1, -3, -1) == lottery(0, 0, 1) == 0
Example #21
0
def test_lottery_3():
    """Should return 1, since both b and c are different from a."""
    assert lottery(1, 2, 3) == lottery(-1, -2, -3) == lottery(1, 2, 2) == lottery(-1, -2, -2) == 1
Example #22
0
def test_lottery_a_same_b_or_c():
    """Test if a is equal to b or c."""
    assert solution.lottery(1, 5, 1) == 0
    assert solution.lottery(2, 2, 1) == 0
Example #23
0
def test_lottery_a_not_b_c_and_b_is_c():  # test 19
    """A not B and A not C and B == C."""
    assert solution.lottery(1, 2, 2) == 1