示例#1
0
 public void InitAccount()
 {
     // arrange
     source = new Account();
     source.Deposite(200.00F);
     destination = new Account();
     destination.Deposite(150.00F);
 }
示例#2
0
        public void TransferMinFundsFailAll([Values(200, 500)] int a, [Values(0, 20)] int b,
                                            [Values(140, 120)] int c)
        {
            Account source = new Account();

            source.Deposite(a);
            Account destination = new Account();

            destination.Deposite(b);
            destination = source.TransferMinFunds(destination, c);
        }
示例#3
0
        public void TransferMinFunds(int a, int b, int c)
        {
            Account source = new Account();

            source.Deposite(a);
            Account destination = new Account();

            destination.Deposite(b);

            source.TransferMinFunds(destination, c);
            Assert.AreEqual(c, destination.Balance);
        }
示例#4
0
 public Account TransferMinFunds(Account destination, float amount)
 {
     if (Balance - amount > MinBalance)
     {
         destination.Deposite(amount);
         Withdraw(amount);
     }
     else
     {
         throw new NotEnoughFundsException();
     }
     return(destination);
 }
示例#5
0
        public void TransferMinFundsFail(int a, int b, int c)
        {
            Account source = new Account();

            source.Deposite(a);
            Account destination = new Account();

            destination.Deposite(b);

            Assert.Throws <NotEnoughFundsException>(delegate
            {
                destination = source.TransferMinFunds(destination, c);
            });
        }
示例#6
0
 public void TransferFunds(Account destination, float amount)
 {
     destination.Deposite(amount);
     Withdraw(amount);
 }