Example #1
0
        public decimal Deposit(decimal amount)
        {
            balance += amount;

            BankTransaction bankTransaction = new BankTransaction(amount);

            transactionQueue.Enqueue(bankTransaction);
            return(balance);
        }
Example #2
0
        public bool Withdraw(decimal amount)
        {
            if (balance - amount < 0)
            {
                return(false);
            }

            balance -= amount;
            BankTransaction bankTransaction = new BankTransaction(-amount);

            transactionQueue.Enqueue(bankTransaction);

            return(true);
        }