Exemplo n.º 1
0
def test_verify_invalid_credential_authentication():
    incorrect_credential = ["John Doe", 4520038156423988, "2/26", 298]

    card = creditcard()
    assert card.verify_credential_authentication(
        incorrect_credential) == False, "Credit card information is incorrect"
Exemplo n.º 2
0
def test_invalid_CVC_key():
    invalid_CVC = [13, 9, "word", "McMaster", None]
    CVC_key = creditcard()
    for CVC in invalid_CVC:
        assert CVC_key.verify_CVC_key(
            CVC) == False, "Credit card CVC key should be invalid"
Exemplo n.º 3
0
def test_verify_valid_credential_authentication():
    correct_credential = ["John Doe", 4520038156423956, "2/23", 199]

    card = creditcard()
    assert card.verify_credential_authentication(
        correct_credential) == True, "Credit card information is correct"
Exemplo n.º 4
0
def test_valid_CVC_key():
    valid_CVC = [138, 939, 199, 885, 500]
    CVC_key = creditcard()
    for CVC in valid_CVC:
        assert CVC_key.verify_CVC_key(
            CVC) == True, "Credit card CVC key should be valid"
Exemplo n.º 5
0
def test_invalid_expirydate():
    invalid_expdate = ["18/23", "6/35", "855", "Date", None]
    card_date = creditcard()
    for date in invalid_expdate:
        assert card_date.verify_expirydate(
            date) == False, "Credit card expiry date should be invalid"
Exemplo n.º 6
0
def test_valid_expirydate():
    valid_expdate = ["2/23", "6/25", "8/3", "5/29", "12/30"]
    card_date = creditcard()
    for date in valid_expdate:
        assert card_date.verify_expirydate(
            date) == True, "Credit card expiry date should be valid"
Exemplo n.º 7
0
def test_invalid_creditcard_number():
    invalid_number = [85632, 123456, "8888", 9832.667, None]
    card_number = creditcard()
    for number in invalid_number:
        assert card_number.verify_creditcard_number(
            number) == False, "Credit card number should be invalid"
Exemplo n.º 8
0
def test_valid_creditcard_number():
    valid_number = [4520038156423956, 4105865219623654, 4562321056428926]
    card_number = creditcard()
    for number in valid_number:
        assert card_number.verify_creditcard_number(
            number) == True, "Credit card number should be valid"