public ProviderQuarterlyUpdateEmail( IProviderQuarterlyUpdateEmailService providerQuarterlyUpdateEmailService, IRepository <FunctionLog> functionLogRepository) { _providerQuarterlyUpdateEmailService = providerQuarterlyUpdateEmailService; _functionLogRepository = functionLogRepository; }
public When_ProviderQuarterlyUpdateEmail_Controller_ConfirmSendProviderEmail_Post_Is_Called_With_SendEmail_False() { var providerService = Substitute.For <IProviderService>(); _providerQuarterlyUpdateEmailService = Substitute.For <IProviderQuarterlyUpdateEmailService>(); const string adminEmail = "*****@*****.**"; var configuration = new MatchingConfiguration { AuthorisedAdminUserEmail = adminEmail }; var providerQuarterlyUpdateEmailController = new ProviderQuarterlyUpdateEmailController(_providerQuarterlyUpdateEmailService, providerService, configuration); var controllerWithClaims = new ClaimsBuilder <ProviderQuarterlyUpdateEmailController>(providerQuarterlyUpdateEmailController) .Add(ClaimTypes.Role, RolesExtensions.AdminUser) .AddEmail(adminEmail) .Build(); var viewModel = new ConfirmSendProviderEmailViewModel { ProviderCount = 100, SendEmail = false }; _result = controllerWithClaims.ConfirmSendProviderEmailAsync(viewModel).GetAwaiter().GetResult(); }
public ProviderQuarterlyUpdateEmailController(IProviderQuarterlyUpdateEmailService providerQuarterlyUpdateEmailService, IProviderService providerService, MatchingConfiguration configuration) { _providerService = providerService; _providerQuarterlyUpdateEmailService = providerQuarterlyUpdateEmailService; _configuration = configuration; }
public When_SendProviderQuarterlyUpdateEmails_Function_Queue_Trigger_Fires() { _providerQuarterlyUpdateService = Substitute.For <IProviderQuarterlyUpdateEmailService>(); _functionLogRepository = Substitute.For <IRepository <FunctionLog> >(); var providerQuarterlyUpdateEmailFunctions = new Functions.ProviderQuarterlyUpdateEmail(_providerQuarterlyUpdateService, _functionLogRepository); providerQuarterlyUpdateEmailFunctions.SendProviderQuarterlyUpdateEmailsAsync( new SendProviderQuarterlyUpdateEmail { BackgroundProcessHistoryId = 1 }, new ExecutionContext(), new NullLogger <Functions.Proximity>() ).GetAwaiter().GetResult(); }