-
Notifications
You must be signed in to change notification settings - Fork 1
/
test_bank_account.py
24 lines (17 loc) · 940 Bytes
/
test_bank_account.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import unittest
from bank_account import BankAccount, MinimumBalanceAccount
class AccountBalanaceTestCase(unittest.TestCase):
def setUp(self):
self.account_yangu = BankAccount()
def test_balance(self):
self.assertEqual(self.account_yangu.balance, 3000, msg='Account Balance Invalid.')
def test_deposit(self):
self.account_yangu.deposit(4000)
self.assertEqual(self.account_yangu.balance, 7000, msg='Deposit Method Inaccurate.')
def test_withdraw(self):
self.account_yangu.withdraw(500)
self.assertEqual(self.account_yangu.balance, 2500, msg='Withdraw method Inaccurate.')
def test_invalid_transaction(self):
self.assertEqual(self.account_yangu.withdraw(6000), "Invalid Transaction", msg='Invalid Transaction.')
def test_sub_class(self):
self.assertTrue(issubclass(MinimumBalanceAccount, BankAccount), msg='Not True subclass of Balance Account.')