예제 #1
0
def test_new_donor():
    name = "Ada Lovelace"
    amt = 345
    d = Donor(name)
    d.add_donation(amt)
    name2 = "Marge Simpson"
    amt2 = 500
    d2 = Donor(name2)
    d2.add_donation(amt2)
    t = Transactions()
    t.add_donor(name, amt)
    assert t.get_donor(name2) is None
    t.add_donor(name2, amt2)
    assert t.get_donor(name2).name == name2
    assert t.get_donor(name2).most_recent_donation == amt2
예제 #2
0
 def test_add_donors_to_transactions(self, mocked_input):
     name = "Ada Lovelace"
     amt = 345
     d = Donor(name)
     d.add_donation(amt)
     name2 = "Marge Simpson"
     amt2 = 500
     d2 = Donor(name2)
     d2.add_donation(amt2)
     t = Transactions()
     t.add_donor(name, amt)
     t.add_donor(name2, amt2)
     assert t.get_donor(name).name == name
     assert t.get_donor(name2).name == name2
     assert t.get_donor(name).most_recent_donation == amt
     assert t.get_donor(name2).most_recent_donation == amt2
예제 #3
0
def test_create_transactions():
    name = "Ada Lovelace"
    amt = 345
    d = Donor(name)
    d.add_donation(amt)
    t = Transactions()
    t.add_donor(name, amt)
    assert t.get_donor(name).name == name
예제 #4
0
 def test_create_transactions(self, mocked_input, decorated_function):
     name = "Ada Lovelace"
     amt = 345
     d = Donor(name)
     d.add_donation(amt)
     t = Transactions()
     t.add_donor(name, amt)
     assert t.get_donor(name).name == name