Beispiel #1
0
        /// <summary>
        /// Adds a new account if it doesn't exist.
        /// </summary>
        public void AddBankAccount(BankAccount account)
        {
            CheckAccount(account);
            bool hasAccount = _storage.AccountExists(account);

            if (!hasAccount)
            {
                _storage.AddAccount(account);
            }
            else
            {
                throw new Exception("Our storage already has this account.");
            }
        }