Esempio n. 1
0
def test_refund_money():
    """自販機に入っているお金が正しく返金されるか"""

    vending_machine = VendingMachine()
    insert_money = [10, 50, 100, 500, 1000]
    vending_machine.insert(insert_money)

    actual_refunded_money = vending_machine.refund_money()
    expected_refunded_money = {10: 1, 50: 1, 100: 1, 500: 1, 1000: 1}

    assert actual_refunded_money == expected_refunded_money

    actual_amount = vending_machine.get_amount()
    expected_amount = 0

    assert actual_amount == expected_amount
 def test_refund_money(self):
     vm = VendingMachine()
     vm.insert_money(10)
     vm.insert_money(500)
     vm.insert_money(1000)
     assert vm.refund_money() == 1510