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

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

            await function.Run(message);

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

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

            response
            .Should()
            .NotBeNull();
        }