Exemplo n.º 1
0
        public Account AddAccount(Account selectedAccount)
        {
            var accountInWork = _accountFactory.CreateAccount(selectedAccount);

            accountInWork.IsClosed = selectedAccount.Is("Закрытые");
            return(!_userEquirer.ToAddAccount(accountInWork) ? null : _accountLowLevelOperator.AddNode(accountInWork));
        }
Exemplo n.º 2
0
        public void CreateAccountWithCodeTest()
        {
            var account = _factory.CreateAccount("Account", "Description", "UAH", 5);


            var newAccount = _storage.CreateAccount(account);


            Assert.AreEqual(5, newAccount.Id);
        }
Exemplo n.º 3
0
        public Account CreateAccount(AccountType type, Customer customer)
        {
            Account acc = _accountFactory.CreateAccount(type, customer);

            if (acc != null)
            {
                _accounts.Add(acc.AccountNumber, acc);
                acc.Customer = customer;
                customer.AddAccount(acc);
            }
            return(acc);
        }
Exemplo n.º 4
0
        public static IAccount Convert(IDictionary <string, object> line, IAccountFactory accountFactory)
        {
            var name        = line["name"].ToString();
            var description = line["description"].ToString();
            var currency    = line["currency"].ToString();
            var account     = accountFactory.CreateAccount(name, description, currency);

            account.Id        = (long)line["id"];
            account.Timestamp = DateTime.Parse(line["timestamp"].ToString());

            return(account);
        }
Exemplo n.º 5
0
        public void testOneAccount()
        {
            Customer oscar = new Customer("Oscar").openAccount(accountFactory.CreateAccount(AccountType.SAVINGS));

            Assert.AreEqual(1, oscar.getNumberOfAccounts());
        }
Exemplo n.º 6
0
        public void checkingAccount()
        {
            Bank     bank            = new Bank();
            Account  checkingAccount = accountFactory.CreateAccount(AccountType.CHECKING);
            Customer bill            = new Customer("Bill").openAccount(checkingAccount);

            bank.addCustomer(bill);

            checkingAccount.deposit(100.0);

            Assert.AreEqual(0.1, bank.totalInterestPaid(), DOUBLE_DELTA);
        }
Exemplo n.º 7
0
        public IAccount CreateAccount(string name, string description, string currency)
        {
            var account = AccountFactory.CreateAccount(name, description, currency);

            return(CreateAccount(account));
        }
Exemplo n.º 8
0
 public AccountControler(IAccountFactory acc)
 {
     this._account = acc.CreateAccount();
 }
Exemplo n.º 9
0
        public void CrateAccount(AccountType accountType)
        {
            var newAccount = accountFactory.CreateAccount(accountType);

            accountRepository.NewAccount(newAccount);
        }