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

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

            await function.Run(message);

            log.LogInformation($"C# Queue trigger function processed: {item}");
        }
示例#2
0
        public async Task OnPublishBatchProviderFunding_SmokeTestSucceeds()
        {
            OnPublishBatchProviderFunding onPublishFunding = new OnPublishBatchProviderFunding(_logger,
                                                                                               _publishService,
                                                                                               Services.BuildServiceProvider().GetRequiredService <IMessengerService>(),
                                                                                               _userProfileProvider,
                                                                                               IsDevelopment);

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

            response
            .Should()
            .NotBeNull();
        }