def test_take_no_bill(self): bill = None desk = CashDesk() expected_dict = {} desk.take_money(bill) self.assertEqual(desk.get_dict(), expected_dict)
def test_take_batch(self): batch = BatchBill([Bill(5), Bill(10), Bill(15)]) desk = CashDesk() expected_dict = {Bill(5): 1, Bill(10): 1, Bill(15): 1} desk.take_money(batch) self.assertEqual(desk.get_dict(), expected_dict)
def test_take_one_bill(self): bill = Bill(10) desk = CashDesk() expected_dict = {Bill(10): 1} desk.take_money(bill) self.assertEqual(desk.get_dict(), expected_dict)
def test_take_more_different_bills_consecutively(self): bill1 = Bill(10) bill2 = Bill(15) desk = CashDesk() expected_dict = {Bill(10): 1, Bill(15): 1} desk.take_money(bill1) desk.take_money(bill2) self.assertEqual(desk.get_dict(), expected_dict)