public void Create(BankAccountDTO account) { if (context.AccountOwnerSet.Find(account.Owner.PassportID) == null) { context.AccountOwnerSet.Add(account.Owner.FromDTO()); } context.BankAccountSet.Add(account.FromDTO()); }
public void FromDTOTest(BankAccountDTO dto) { var account = dto.FromDTO(); Assert.That(account.IBAN == dto.IBAN && account.Owner.Email == dto.Owner.Email && account.Owner.FullName == dto.Owner.FullName && account.Owner.PassportID == dto.Owner.PassportID && account.Balance == dto.Balance && account.BonusPoints == dto.BonusPoints && account.GetType().Name == dto.Type.ToString()); }