Example #1
0
 public void InitAccount()
 {
     // arrange
     source = new Account();
     source.Deposite(200.00F);
     destination = new Account();
     destination.Deposite(150.00F);
 }
Example #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);
        }
Example #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);
        }
Example #4
0
 public Account TransferMinFunds(Account destination, float amount)
 {
     if (Balance - amount > MinBalance)
     {
         destination.Deposite(amount);
         Withdraw(amount);
     }
     else
     {
         throw new NotEnoughFundsException();
     }
     return(destination);
 }
Example #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);
            });
        }
Example #6
0
 public void TransferFunds(Account destination, float amount)
 {
     destination.Deposite(amount);
     Withdraw(amount);
 }