public async Task <List <string> > GetEmailsAsync(long providerId, string lastUpdateEmail) { List <string> addresses; if (!_configuration.UseProviderEmail) { _logger.Info($"Getting provider test email (${string.Join(", ", _configuration.ProviderTestEmails)})"); return(_configuration.ProviderTestEmails); } if (!string.IsNullOrEmpty(lastUpdateEmail)) { return new List <string> { lastUpdateEmail } } ; addresses = await _idamsEmailServiceWrapper.GetEmailsAsync(providerId); if (addresses.Any()) { return(addresses); } addresses = await _idamsEmailServiceWrapper.GetSuperUserEmailsAsync(providerId); if (addresses.Any()) { return(addresses); } if (GetProviderAddresses(providerId, out addresses)) { return(addresses); } if (!addresses.Any()) { _logger.Warn($"Could not find any email adresses for provider: {providerId}"); } return(addresses); }
public void ShouldThrowIfGetSupersUsersResponseIsEmpty() { Assert.ThrowsAsync <ArgumentException>(() => _sut.GetSuperUserEmailsAsync(10005143L)); }
public async Task ShouldReturnEmpltyListIfResponseIsEmptyForSuperUser() { var res = await _sut.GetSuperUserEmailsAsync(10005143L); res.Count.ShouldBeEquivalentTo(0); }