示例#1
0
 public void TestDepositW6()
 {
     long accountNo = 123;
     double balance = 1000.00;
     double interestRate = 0.5;
     Account a = new Account(accountNo, balance, interestRate);
     a.Deposit(1000);
     double expected = 2000;
     double actual = a.Balance;
     Assert.AreEqual(expected, actual);
 }
示例#2
0
 public void TestDepositW5()
 {
     long accountNo = 123;
     double balance = 1000.00;
     double interestRate = 0.5;
     Account a = new Account(accountNo, balance, interestRate);
     try
     {
         a.Deposit(0);
         Assert.Fail("Should throw an exception");
     }
     catch (InvalidAmountOrBalanceException)
     {
     }
 }