public void AccoutTypeMapperToDTOTest() { AccountType accountType = AccountType.BASE; AccountTypeDTO accountTypeDTO = AccountTypeMapper.MapAccountTypeToDTO(accountType); Assert.That(accountType.ToString(), Is.EqualTo(accountTypeDTO.ToString())); }
/// <summary> /// Withdraws the amount from the account with given account number /// </summary> /// <param name="accountNumber">String of the account number</param> /// <param name="amount">The amount to withdraw</param> public void WithdrawAccount(string accountNumber, decimal amount) { DAL.Interface.DTO.Account account = _repository.GetAccount(accountNumber); IBonus bonus = new BonusCounter().GetBonus(AccountTypeMapper.GetBusinessAccountType(account.AccountType)); _repository.WithdrawAccount(accountNumber, amount, bonus.GetSubBonus(amount)); }
public void AddAccount(Holder holder, string type) { var id = _accountIdService.GenerateAccountId(); var accountType = AccountTypeMapper.GetAccountType(type); var account = new Account(id, 0, holder, accountType, new Bonus()); _repository.Add(account.ToDTOAccount()); holder.Accounts.Add(id); }