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