def test_maxi_savings_account(): bank = Bank() maxiSavingsAccount = Account(MAXI_SAVINGS) bank.addCustomer(Customer("Bill").openAccount(maxiSavingsAccount)) maxiSavingsAccount.deposit(3000.0) assert_equals(maxiSavingsAccount.checkTransactionInLastTenDays(), True) assert_equals(3000 * 0.001 * DateProvider.getTotalDaysPassedRatio(), maxiSavingsAccount.interestEarned())
def test_check_transaction_in_last_10_days(): bank = Bank() maxiSavingsAccount = Account(MAXI_SAVINGS) bank.addCustomer(Customer("Bill").openAccount(maxiSavingsAccount)) maxiSavingsAccount.deposit(3000.0) assert_equals(maxiSavingsAccount.transactions[0].amount, 3000) assert_equals(maxiSavingsAccount.transactions[0].transactionDate.year, DateProvider.now().year) assert_equals(maxiSavingsAccount.transactions[0].transactionDate.month, DateProvider.now().month) assert_equals(maxiSavingsAccount.transactions[0].transactionDate.day, DateProvider.now().day) assert_equals(maxiSavingsAccount.transactions[0].transactionDate >= DateProvider.tenDaysAgo(), True) assert_equals(maxiSavingsAccount.checkTransactionInLastTenDays(), True)