Ejemplo n.º 1
0
 public void Init()
 {
     source = new Account();
     source.Deposit(200.00F);
     destination = new Account();
     destination.Deposit(150.00F);
 }
Ejemplo n.º 2
0
        public void the_balance_should_increase_correctly()
        {
            var account = new Account();

            account.Deposit(100);

            Assert.AreEqual(100, account.Balance);
        }
Ejemplo n.º 3
0
 public void TransferFunds(Account destination, float amount)
 {
     destination.Deposit(amount);
     if ((balance - amount) < minimumBalance)
     {
         throw new InsufficientFundsException();
     }
     Withdraw(amount);
 }
Ejemplo n.º 4
0
        public void the_balance_should_increase_correctly_when_there_is_an_existing_balance()
        {
            var account = new Account();

            account.Deposit(10);
            account.Deposit(100);

            Assert.AreEqual(110, account.Balance);
        }
Ejemplo n.º 5
0
        public void TransferFunds()
        {
            Account source = new Account();
            source.Deposit(200.00F);
            Account destination = new Account();
            destination.Deposit(150.00F);

            source.TransferFunds(destination, 100.00F);
            Assert.AreEqual(250.00F, destination.Balance);
            Assert.AreEqual(100.00F, source.Balance);
        }
Ejemplo n.º 6
0
        public void the_Account_should_not_be_charged_a_flat_fee_if_goes_negative_with_Sullis_snazzy_overdraft_protection()
        {
            var account = new Account(100);

            account.Withdraw(130);

            Assert.AreEqual(-55, account.Balance);
        }
Ejemplo n.º 7
0
 public void TransferFunds(Account destination, float amount)
 {
 }
Ejemplo n.º 8
0
 public void TransferFunds(Account destination, float amount)
 {
     if (IsValidAmountAndBalance(amount)) return;
     destination.Deposit(amount);
     Withdraw(amount);
 }
Ejemplo n.º 9
0
        public void the_Account_should_be_charged_a_flat_fee_if_goes_negative()
        {
            var account = new Account(100);

            account.Withdraw(130);

            Assert.AreEqual(-55, account.Balance);
        }
Ejemplo n.º 10
0
        public void the_Account_balance_should_decrease()
        {
            var account = new Account(100);

            account.Withdraw(30);

            Assert.AreEqual(70, account.Balance);
        }
Ejemplo n.º 11
0
 public void the_initial_balance_should_not_be_negative()
 {
     var account = new Account(-100.0F);
 }
Ejemplo n.º 12
0
        public void the_initial_balance_should_be_set_correctly_if_specified()
        {
            var account = new Account(100.0F);

            Assert.AreEqual(100, account.Balance);
        }
Ejemplo n.º 13
0
        public void the_initial_balance_should_be_zero_if_not_specified()
        {
            var account = new Account();

            Assert.AreEqual(0, account.Balance);
        }
Ejemplo n.º 14
0
        public void the_balance_of_the_source_account_should_not_change()
        {
            var source = new Account();
            source.Deposit(200.00F);
            var destination = new Account();
            destination.Deposit(150.00F);

            source.TransferFunds(destination, 201.00F);
            Assert.AreEqual(200.00F, source.Balance);
        }
Ejemplo n.º 15
0
        public void the_Amount_should_be_withdrawn_from_the_source_account()
        {
            var source = new Account();
            source.Deposit(200.00F);
            var destination = new Account();
            destination.Deposit(150.00F);

            source.TransferFunds(destination, 100.00F);
            Assert.AreEqual(100.00F, source.Balance);
        }
Ejemplo n.º 16
0
        public void the_Amount_should_be_deposited_into_the_destination_account()
        {
            var source = new Account();
            source.Deposit(200.00F);
            var destination = new Account();
            destination.Deposit(150.00F);

            source.TransferFunds(destination, 100.00F);
            Assert.AreEqual(250.00F, destination.Balance);
        }
Ejemplo n.º 17
0
        public void the_amount_and_the_balance_should_be_valid()
        {
            var source = new Account();
            source.Deposit(200.00F);
            var destination = new Account();
            destination.Deposit(150.00F);

            Assert.IsTrue(source.IsValidAmountAndBalance(201.00F));
        }