示例#1
0
 public void BlackWithdrawAmountToZero()
 {
     BankAppViewModel ba = new BankAppViewModel();
     ba.SelectedAccount = new Account("Account 1", 500.00, 0.013);
     ba.WithdrawAmount(500);
     double expected = 500 - 500;
     double actual = ba.SelectedAccount.Amount;
     Assert.AreEqual(expected, actual);
 }
示例#2
0
 public void BlackInterestAdd()
 {
     BankAppViewModel ba = new BankAppViewModel();
     ba.SelectedAccount = new Account("Account 1", 500.00, 0.013);
     ba.AddInterest(51);
     double expected = 500 + (500 * 0.013);
     double actual = ba.SelectedAccount.Amount;
     Assert.AreEqual(expected, actual);
 }
示例#3
0
        public void BlackWithdrawAmountZero()
        {
            BankAppViewModel ba = new BankAppViewModel();
            ba.SelectedAccount = new Account("Account 1", 500.00, 0.013);

            try
            {
                ba.WithdrawAmount(0);
                Assert.Fail("It is supposed to fail, because you cant withdraw 0");
            }
            catch (InvalidWithdrawException)
            {
            }
        }
示例#4
0
        public void BlackWithdrawAmountOverBalance()
        {
            BankAppViewModel ba = new BankAppViewModel();
            ba.SelectedAccount = new Account("Account 1", 500.00, 0.013);

            try
            {
                ba.WithdrawAmount(501);
                Assert.Fail("It is supposed to fail, because you can not withdraw more than is in the account");
            }
            catch (InvalidWithdrawException)
            {
            }
        }
示例#5
0
 public void WhiteDepositAmount()
 {
     BankAppViewModel ba = new BankAppViewModel();
     ba.SelectedAccount = new Account("Account 1", 1500.0, 0.013);
     ba.DepositAmount(500);
     double expected = 1500.00 + 500.00;
     double actual = ba.SelectedAccount.Amount;
     Assert.AreEqual(expected, actual);
 }
示例#6
0
 public void WhiteWithdrawMoreThanThousand()
 {
     BankAppViewModel ba = new BankAppViewModel();
     ba.SelectedAccount = new Account("Account 1", 1500.0, 0.013);
     try
     {
         ba.WithdrawAmount(1001.00);
         Assert.Fail("It is supposed to fail, because you cant withdraw more than 1000.00");
     }
     catch (InvalidWithdrawException)
     {
     }
 }
示例#7
0
 public void WhiteDepositZero()
 {
     BankAppViewModel ba = new BankAppViewModel();
     ba.SelectedAccount = new Account("Account 1", 1500.0, 0.013);
     try
     {
         ba.DepositAmount(0.00);
         Assert.Fail("It is supposed to fail, because you cant deposit 0.00");
     }
     catch (InvalidDepositException)
     {
     }
 }
示例#8
0
 public void WhiteDepositMoreThanTenThousand()
 {
     BankAppViewModel ba = new BankAppViewModel();
     ba.SelectedAccount = new Account("Account 1", 1500.0, 0.013);
     try
     {
         ba.DepositAmount(10000.01);
         Assert.Fail("It is supposed to fail, because you cant deposit more than 10000.00");
     }
     catch (InvalidDepositException)
     {
     }
 }