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

            account.Deposit(100);

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

            account.Withdraw(30);

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

            Assert.AreEqual(100, account.Balance);
        }
예제 #13
0
        public void the_initial_balance_should_be_zero_if_not_specified()
        {
            var account = new Account();

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