public static async Task RunOnProviderSnapshotDataLoadEventTrigger([QueueTrigger(ServiceBusConstants.QueueNames.ProviderSnapshotDataLoad, Connection = "AzureConnectionString")] string item, ILogger log) { using IServiceScope scope = Functions.Providers.Startup.RegisterComponents(new ServiceCollection()).CreateScope(); Message message = Helpers.ConvertToMessage <string>(item); OnProviderSnapshotDataLoadEventTrigger function = scope.ServiceProvider.GetService <OnProviderSnapshotDataLoadEventTrigger>(); await function.Run(message); log.LogInformation($"C# Queue trigger function processed: {item}"); }
public async Task OnProviderSnapshotDataLoadEvent_SmokeTestSucceeds() { OnProviderSnapshotDataLoadEventTrigger onProviderSnapshotDataLoadEventTrigger = new OnProviderSnapshotDataLoadEventTrigger(_logger, Services.BuildServiceProvider().GetRequiredService <IMessengerService>(), _userProfileProvider, _providerSnapshotDataLoadService, IsDevelopment); SmokeResponse response = await RunSmokeTest(ServiceBusConstants.QueueNames.ProviderSnapshotDataLoad, async(Message smokeResponse) => await onProviderSnapshotDataLoadEventTrigger.Run(smokeResponse), useSession : true); response .Should() .NotBeNull(); }