예제 #1
0
        public static async Task RunReIndexCalculationResults([QueueTrigger(ServiceBusConstants.QueueNames.ReIndexCalculationResultsIndex, Connection = "AzureConnectionString")] string item, ILogger log)
        {
            using IServiceScope scope = Functions.Results.Startup.RegisterComponents(new ServiceCollection()).CreateScope();

            Message message = Helpers.ConvertToMessage <string>(item);

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

            await function.Run(message);

            log.LogInformation($"C# Queue trigger function processed: {item}");
        }
        public async Task OnReIndexCalculationResults_SmokeTestSucceeds()
        {
            OnReIndexCalculationResults onReIndexCalculationResults = new OnReIndexCalculationResults(_logger,
                                                                                                      _providerCalculationResultsReIndexerService,
                                                                                                      Services.BuildServiceProvider().GetRequiredService <IMessengerService>(),
                                                                                                      _userProfileProvider,
                                                                                                      IsDevelopment);

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

            response
            .Should()
            .NotBeNull();
        }