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