Exemple #1
0
 public void Init()
 {
     source = new Account();
     source.Deposit(200.00F);
     destination = new Account();
     destination.Deposit(150.00F);
 }
        public void the_balance_should_increase_correctly()
        {
            var account = new Account();

            account.Deposit(100);

            Assert.AreEqual(100, account.Balance);
        }
Exemple #3
0
 public void TransferFunds(Account destination, float amount)
 {
     destination.Deposit(amount);
     if ((balance - amount) < minimumBalance)
     {
         throw new InsufficientFundsException();
     }
     Withdraw(amount);
 }
        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);
        }
Exemple #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);
        }
        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);
        }
Exemple #7
0
 public void TransferFunds(Account destination, float amount)
 {
 }
 public void TransferFunds(Account destination, float amount)
 {
     if (IsValidAmountAndBalance(amount)) return;
     destination.Deposit(amount);
     Withdraw(amount);
 }
        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);
        }
        public void the_Account_balance_should_decrease()
        {
            var account = new Account(100);

            account.Withdraw(30);

            Assert.AreEqual(70, account.Balance);
        }
 public void the_initial_balance_should_not_be_negative()
 {
     var account = new Account(-100.0F);
 }
        public void the_initial_balance_should_be_set_correctly_if_specified()
        {
            var account = new Account(100.0F);

            Assert.AreEqual(100, account.Balance);
        }
        public void the_initial_balance_should_be_zero_if_not_specified()
        {
            var account = new Account();

            Assert.AreEqual(0, account.Balance);
        }
        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);
        }
        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);
        }
        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);
        }
        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));
        }