Esempio n. 1
0
        public void Init()
        {
            // create two accounts in a known start state
            source = new SimpleAccount();
            source.Deposit(200);

            destination = new SimpleAccount();
            destination.Deposit(150);
        }
Esempio n. 2
0
        public void TransferFunds(SimpleAccount destination, decimal amount)
        {
            // TODO - Implement Me.

            #region Implementation

            //destination.Deposit(amount);
            //Withdraw(amount);

            #endregion

            #region Implemented with Exception

            destination.Deposit(amount);

            if (balance - amount < 0)
                throw new InsufficientFundsException();

            Withdraw(amount);

            #endregion
        }