class CashDeskTest(unittest.TestCase):
    def setUp(self):
        self.cash_desk = CashDesk()

    def test_cashdesk_empty_when_created(self):
        self.assertEqual(self.cash_desk.money, {
            100: 0,
            50: 0,
            20: 0,
            10: 0,
            5: 0,
            2: 0,
            1: 0
        })
        self.assertEqual(self.cash_desk.total(), 0)

    def test_take_money(self):
        self.cash_desk.take_money({1: 2, 50: 1, 20: 1})
        self.assertEqual(self.cash_desk.total(), 72)
        self.cash_desk.take_money({1: 1, 2: 1, 5: 1, 20: 1})
        self.assertEqual(self.cash_desk.total(), 100)

    def test_can_withdraw_money(self):
        self.cash_desk.take_money({50: 1, 100: 2})
        self.assertTrue(self.cash_desk.can_withdraw_money(250))
        self.assertTrue(self.cash_desk.can_withdraw_money(150))
        self.assertFalse(self.cash_desk.can_withdraw_money(70))
        self.assertFalse(self.cash_desk.can_withdraw_money(180))
class CashDeskTests(unittest.TestCase):
    def setUp(self):
        self.my_cash_desk = CashDesk()

    def test_init(self):
        self.assertEqual({100: 0, 50: 0, 20: 0, 10: 0, 5: 0, 2: 0, 1: 0}, self.my_cash_desk.money)

    def test_take_money(self):
        self.my_cash_desk.take_money({1: 2, 50: 1, 20: 1})
        self.assertEqual({100: 0, 50: 1, 20: 1, 10: 0, 5: 0, 2: 0, 1: 2}, self.my_cash_desk.money)

    def test_total(self):
        self.my_cash_desk.take_money({1: 2, 50: 1, 20: 1})
        self.assertEqual(72, self.my_cash_desk.total())

    def test_can_withdraw_money_no_such_banknotes(self):
        self.my_cash_desk.take_money({1: 2, 50: 1, 20: 1})
        self.assertFalse(self.my_cash_desk.can_withdraw_money(30))

    def test_can_withdraw_money_possible(self):
        self.my_cash_desk.take_money({1: 2, 50: 1, 20: 1})
        self.assertTrue(self.my_cash_desk.can_withdraw_money(70))
class CashDeskTests(unittest.TestCase):
    def setUp(self):
        self.my_cash_desk = CashDesk()

    def test_init(self):
        self.assertEqual({
            100: 0,
            50: 0,
            20: 0,
            10: 0,
            5: 0,
            2: 0,
            1: 0
        }, self.my_cash_desk.money)

    def test_take_money(self):
        self.my_cash_desk.take_money({1: 2, 50: 1, 20: 1})
        self.assertEqual({
            100: 0,
            50: 1,
            20: 1,
            10: 0,
            5: 0,
            2: 0,
            1: 2
        }, self.my_cash_desk.money)

    def test_total(self):
        self.my_cash_desk.take_money({1: 2, 50: 1, 20: 1})
        self.assertEqual(72, self.my_cash_desk.total())

    def test_can_withdraw_money_no_such_banknotes(self):
        self.my_cash_desk.take_money({1: 2, 50: 1, 20: 1})
        self.assertFalse(self.my_cash_desk.can_withdraw_money(30))

    def test_can_withdraw_money_possible(self):
        self.my_cash_desk.take_money({1: 2, 50: 1, 20: 1})
        self.assertTrue(self.my_cash_desk.can_withdraw_money(70))
class CashDeskTest(unittest.TestCase):

    def setUp(self):
        self.cash_desk = CashDesk()

    def test_cashdesk_empty_when_created(self):
        self.assertEqual(
            self.cash_desk.money, {100: 0, 50: 0, 20: 0, 10: 0,
                                   5: 0, 2: 0, 1: 0})
        self.assertEqual(self.cash_desk.total(), 0)

    def test_take_money(self):
        self.cash_desk.take_money({1: 2, 50: 1, 20: 1})
        self.assertEqual(self.cash_desk.total(), 72)
        self.cash_desk.take_money({1: 1, 2: 1, 5: 1, 20: 1})
        self.assertEqual(self.cash_desk.total(), 100)

    def test_can_withdraw_money(self):
        self.cash_desk.take_money({50: 1, 100: 2})
        self.assertTrue(self.cash_desk.can_withdraw_money(250))
        self.assertTrue(self.cash_desk.can_withdraw_money(150))
        self.assertFalse(self.cash_desk.can_withdraw_money(70))
        self.assertFalse(self.cash_desk.can_withdraw_money(180))
 def test_can_withdraw_cant_withdraw(self):
     new_cash_desk = CashDesk()
     new_cash_desk.take_money({1: 2, 100: 3})
     self.assertFalse(new_cash_desk.can_withdraw_money(105))
 def test_can_withdraw_not_all_money(self):
     new_cash_desk = CashDesk()
     new_cash_desk.take_money({1: 2, 100: 3})
     self.assertTrue(new_cash_desk.can_withdraw_money(301))
 def can_withdraw_money(self):
     my_CashDesk = CashDesk()
     my_CashDesk.take_money({1: 2, 100: 3})
     self.assertTrue(my_CashDesk.can_withdraw_money(2))
     self.assertTrue(my_CashDesk.can_withdraw_money(302))
     self.assertFalse(my_CashDesk.can_withdraw_money(5))
 def test_can_withdraw_cant_withdraw(self):
     new_cash_desk = CashDesk()
     new_cash_desk.take_money({1: 2, 100: 3})
     self.assertFalse(new_cash_desk.can_withdraw_money(105))
 def test_can_withdraw_not_all_money(self):
     new_cash_desk = CashDesk()
     new_cash_desk.take_money({1: 2, 100: 3})
     self.assertTrue(new_cash_desk.can_withdraw_money(301))