Exemplo n.º 1
0
        private Account CreateAccount(string accountNumber)
        {
            var account = new Account();

            account.AccountNumber = accountNumber;
            account.Created = DateTime.Now;

            return account;
        }
Exemplo n.º 2
0
 public bool TransferMoney(Account sender, Account recipient, int amount)
 {
     using (this._unitOfWork = this._unitOfWorkFactory.CreateUnitOfWork()) {
         if (AccountRepository.TransferMoney(sender, recipient, amount)) {
             this._unitOfWork.Commit();
             return true;
         }
         return false;
     }
 }
Exemplo n.º 3
0
        public static AccountModel MapFrom(Account account)
        {
            var accountModel = new AccountModel();

            accountModel.Id            = account.Id;
            accountModel.AccountNumber = account.AccountNumber;
            accountModel.Created       = account.Created;

            return accountModel;
        }
Exemplo n.º 4
0
        private Account CreateAccount(string accountNumber)
        {
            var account = new Account();

            account.AccountNumber = accountNumber;
            account.Created = DateTime.Now;

            EntitiesContext.Accounts.Add(account);
            EntitiesContext.SaveChanges();

            Assert.IsTrue(account.Id != 0, "Account kon niet worden aangemaakt");

            return account;
        }
Exemplo n.º 5
0
 public bool TransferMoney(Account sender, Account recipient, int amount)
 {
     sender.Balance    -= amount;
     recipient.Balance += amount;
     return true;
 }