public void maxi_savings_account() { DateTime nowDate=new DateTime(1970,1,1); TestDateProvider provider = new TestDateProvider(() => nowDate); Bank bank = new Bank(); Account maxiSavingsAccount = new AccountFactory(provider).CreateAccount(AccountType.MAXI_SAVINGS); bank.addCustomer(new Customer("Bill").openAccount(maxiSavingsAccount)); maxiSavingsAccount.deposit(3000.0); //change current date to 1970/6/30 nowDate = nowDate + new TimeSpan(180, 0, 0, 0); double expected = 3000.0d.DailyInterest(5.0, 180); Assert.AreEqual(expected, bank.totalInterestPaid(), DOUBLE_DELTA); }
public void maxi_savings_account() { DateTime nowDate = new DateTime(1970, 1, 1); TestDateProvider provider = new TestDateProvider(() => nowDate); Bank bank = new Bank(); Account maxiSavingsAccount = new AccountFactory(provider).CreateAccount(AccountType.MAXI_SAVINGS); bank.addCustomer(new Customer("Bill").openAccount(maxiSavingsAccount)); maxiSavingsAccount.deposit(3000.0); //change current date to 1970/6/30 nowDate = nowDate + new TimeSpan(180, 0, 0, 0); double expected = 3000.0d.DailyInterest(5.0, 180); Assert.AreEqual(expected, bank.totalInterestPaid(), DOUBLE_DELTA); }
public void SetUp() { nowDate = new DateTime(1970, 1, 1); provider = new TestDateProvider(() => nowDate); }