public ProviderEmailLookupService( ILogger logger, IdamsEmailServiceWrapper idamsEmailServiceWrapper, EmployerApprenticeshipsServiceConfiguration employerConfiguration, IApprenticeshipInfoServiceWrapper apprenticeshipInfoService) { _logger = logger; _idamsEmailServiceWrapper = idamsEmailServiceWrapper; _apprenticeshipInfoService = apprenticeshipInfoService; _configuration = employerConfiguration.CommitmentNotification; }
public void SetUp() { var config = new ProviderApprenticeshipsServiceConfiguration { CommitmentNotification = new ProviderNotificationConfiguration { IdamsListUsersUrl = "https://url.to/users/ukprn={0}", ClientToken = "AbbA-Rules-4.Ever" }, }; _mockHttpClientWrapper = new Mock <IHttpClientWrapper>(); _sut = new IdamsEmailServiceWrapper(Mock.Of <ILog>(), config, _mockHttpClientWrapper.Object); }
public void SetUp() { var config = new EmployerCommitmentsServiceConfiguration { CommitmentNotification = new CommitmentNotificationConfiguration { IdamsListUsersUrl = "https://url.to/users/ukprn={0}", ClientToken = "AbbA-Rules-4.Ever" } }; _mockHttpClientWrapper = new Mock <IHttpClientWrapper>(); _sut = new IdamsEmailServiceWrapper(Mock.Of <ILog>(), config, _mockHttpClientWrapper.Object, new NoopExecutionPolicy()); }
public void VerifyIdamsServiceIsNotCalled() { IdamsEmailServiceWrapper.Verify(x => x.GetEmailsAsync(It.IsAny <long>()), Times.Never); IdamsEmailServiceWrapper.Verify(x => x.GetSuperUserEmailsAsync(It.IsAny <long>()), Times.Never); }
public void VerifyWeCallIdamsServiceForThisProvider() { IdamsEmailServiceWrapper.Verify(x => x.GetEmailsAsync(ProviderResponse.Ukprn)); IdamsEmailServiceWrapper.Verify(x => x.GetSuperUserEmailsAsync(ProviderResponse.Ukprn)); }
public WhenSyncingIdamsUsersFixture SetupIdamsToThrowException() { IdamsEmailServiceWrapper.Setup(x => x.GetEmailsAsync(It.IsAny <long>())).Throws <ApplicationException>(); return(this); }