def test_remove_money_success(self): vending_machine = VendingMachine() vending_machine.insert_money(238) removed, total_balance = vending_machine.remove_money(213) self.assertTrue(removed) self.assertEqual(25, total_balance)
def test_remove_money_amount_higher_than_balance(self): vending_machine = VendingMachine() inserted, total_balance = vending_machine.insert_money(23) removed, total_balance_after_removal = vending_machine.remove_money( total_balance * 2) self.assertTrue(removed) self.assertEqual(0, total_balance_after_removal)
def test_remove_money_empty_balance(self): vending_machine = VendingMachine() removed, total_balance = vending_machine.remove_money(89) self.assertFalse(removed)
def test_remove_money_negative_amount(self): vending_machine = VendingMachine() removed, total_balance = vending_machine.remove_money(-124) self.assertFalse(removed)