Ejemplo n.º 1
0
        public void TransferMoneyMethodTest()
        {
            //Arrange
            Account accountFrom = new Account {
                Name = "Tom",
                AccountNumber = "1234567890",
                Balance = 35.00m,
                AccountType = "Checking"
            };

            Account accountTo = new Account {
                Name = "Dave",
                AccountNumber = "0987654321",
                Balance = 732.21m,
                AccountType = "Savings"
            };

            var accService = new AccountService(new Repository(new DataContext()));

            //Act
            accService.TransferMoney(accountFrom, accountTo, 20.0m);
            var result = accountFrom.Balance;
            //Assert

            Assert.AreEqual(result, 15m);
        }
Ejemplo n.º 2
0
        public AccountDTO OpenAccount(string username, string accountType, decimal startingBalance)
        {
            Account newAccount = new Account {
                AccountType = accountType,
                Balance = startingBalance,
                Name = username,
                AccountNumber = GenerateAccountNumber()
            };
            _repo.Add<Account>(newAccount);
            _repo.SaveChanges();

            return Mapper.Map<AccountDTO>(newAccount);
        }
Ejemplo n.º 3
0
 public void AdjustBalance(Account account, decimal dollarAmount)
 {
 }