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

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

            await function.Run(message);

            log.LogInformation($"C# Queue trigger function processed: {item}");
        }
Exemple #2
0
        public async Task OnReIndexPublishedProvider_SmokeTestSucceeds()
        {
            OnReIndexPublishedProviders onReIndexPublishedProviders = new OnReIndexPublishedProviders(_logger,
                                                                                                      _publishedProviderReIndexerService,
                                                                                                      Services.BuildServiceProvider().GetRequiredService <IMessengerService>(),
                                                                                                      _userProfileProvider,
                                                                                                      IsDevelopment);

            SmokeResponse response = await RunSmokeTest(ServiceBusConstants.QueueNames.PublishingReIndexPublishedProviders,
                                                        async(Message smokeResponse) => await onReIndexPublishedProviders.Run(smokeResponse));

            response
            .Should()
            .NotBeNull();
        }