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

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

            await function.Run(message);

            log.LogInformation($"C# Queue trigger function processed: {item}");
        }
Example #2
0
        public async Task OnDeletePublishedProviders_SmokeTestSucceeds()
        {
            OnDeletePublishedProviders onDeletePublishedProvider = new OnDeletePublishedProviders(_logger,
                                                                                                  _deletePublishedProvidersService,
                                                                                                  Services.BuildServiceProvider().GetRequiredService <IMessengerService>(),
                                                                                                  _userProfileProvider,
                                                                                                  IsDevelopment);

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

            response
            .Should()
            .NotBeNull();
        }