Esempio n. 1
0
        public static async Task RunApproveBatchProviderFunding([QueueTrigger(ServiceBusConstants.QueueNames.PublishingApproveBatchProviderFunding, Connection = "AzureConnectionString")] string item, ILogger log)
        {
            using IServiceScope scope = Functions.Publishing.Startup.RegisterComponents(new ServiceCollection()).CreateScope();
            Message message = Helpers.ConvertToMessage <PublishedProviderIdsRequest>(item);

            OnApproveBatchProviderFunding function = scope.ServiceProvider.GetService <OnApproveBatchProviderFunding>();

            await function.Run(message);

            log.LogInformation($"C# Queue trigger function processed: {item}");
        }
Esempio n. 2
0
        public async Task OnApproveBatchProviderFunding_SmokeTestSucceeds()
        {
            OnApproveBatchProviderFunding onApproveProviderFunding = new OnApproveBatchProviderFunding(_logger,
                                                                                                       _approveService,
                                                                                                       Services.BuildServiceProvider().GetRequiredService <IMessengerService>(),
                                                                                                       _userProfileProvider,
                                                                                                       IsDevelopment);

            SmokeResponse response = await RunSmokeTest(ServiceBusConstants.QueueNames.PublishingApproveBatchProviderFunding,
                                                        async(Message smokeResponse) => await onApproveProviderFunding.Run(smokeResponse), useSession : true);

            response
            .Should()
            .NotBeNull();
        }