예제 #1
0
class TestEx6(unittest.TestCase):

    def setUp(self):
        self.current_account = CurrentAccount("jumento juvenal", "123.345-9")

    def test_consult_leftover(self):
        self.current_account.leftover = 23
        self.current_account.leftover |should| equal_to(23)

    def test_deposit_20_in_account_with_10_should_return_30(self):
        self.current_account.leftover = 10
        self.current_account.deposit(20) |should| equal_to(30)

    def test_retire_10_in_account_with_50_should_return_40(self):
        self.current_account.leftover = 50
        self.current_account.retire(10) |should| equal_to(40)

    def test_retire_20_in_account_with_10_should_return_not_enough_money(self):
        self.current_account.leftover = 10
        self.current_account.retire(20) |should| equal_to("not enough money")
        self.current_account.leftover |should| equal_to(10)
예제 #2
0
 def setUp(self):
     self.current_account = CurrentAccount("jumento juvenal", "123.345-9")