示例#1
0
        private async Task <bool> UploadEmails()
        {
            if (_foundPerson.Emails == null)
            {
                return(true);
            }
            try
            {
                _logger.LogDebug($"Attempting to create emails records for SearchRequest[{_searchRequest.SearchRequestId}]");

                foreach (var e in _foundPerson.Emails)
                {
                    EmailEntity email = _mapper.Map <EmailEntity>(e);
                    email.SearchRequest = _searchRequest;
                    //email.SupplierTypeCode = _providerDynamicsID;
                    email.Person = _returnedPerson;
                    SSG_Email ssgEmail = await _searchRequestService.CreateEmail(email, _cancellationToken);
                    await CreateResultTransaction(ssgEmail);
                }
                return(true);
            }
            catch (Exception ex)
            {
                LogException(ex);
                return(false);
            }
        }
        public void SSG_Email_should_map_to_Email_correctly()
        {
            SSG_Email e = new SSG_Email
            {
                Email     = "*****@*****.**",
                EmailType = 867670000
            };

            Email email = _mapper.Map <Email>(e);

            Assert.AreEqual("*****@*****.**", email.EmailAddress);
            Assert.AreEqual("Personal", email.Type);
        }