Exemplo n.º 1
0
    def test_deposit_negative(self):
        test_account1 = Account(100, 1000000)

        self.assertEquals(test_account1.deposit(-50), None)
Exemplo n.º 2
0
    def test_deposit_string(self):
        test_account1 = Account(100, 1000000)

        with self.assertRaises(TypeError):
            test_account1.deposit('hello')
Exemplo n.º 3
0
    def test_withdraw_negative(self):
        test_account1 = Account(100, 1000000)

        self.assertEquals(test_account1.withdraw(-100), None)
Exemplo n.º 4
0
    def test_withdraw_string(self):
        test_account1 = Account(100, 1000000)

        with self.assertRaises(TypeError):
            test_account1.withdraw('hello')
Exemplo n.º 5
0
    def test_deposit_no_amount(self):
        test_account1 = Account(100, 1000000)

        with self.assertRaises(TypeError):
            test_account1.deposit()
Exemplo n.º 6
0
    def test_withdraw_no_amount(self):
        test_account1 = Account(100, 1000000)

        with self.assertRaises(TypeError):
            test_account1.withdraw()
Exemplo n.º 7
0
    def test_deposit(self):
        test_account1 = Account(100, 1000000)
        test_account1.deposit(100)

        self.assertEquals(test_account1.balance, 200)
Exemplo n.º 8
0
    def test_withdraw(self):
        test_account1 = Account(100, 1000000)
        test_account1.withdraw(50)

        self.assertEquals(test_account1.balance, 45)