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