Exemplo n.º 1
0
        public static async Task RunPublishProviderResults([QueueTrigger(ServiceBusConstants.QueueNames.ProcessDataset, Connection = "AzureConnectionString")] string item, ILogger log)
        {
            using (IServiceScope scope = Functions.Datasets.Startup.RegisterComponents(new ServiceCollection()).CreateScope())
            {
                CultureInfo.CurrentCulture = new CultureInfo("en-GB");
                Message message = Helpers.ConvertToMessage <Dataset>(item);

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

                await function.Run(message);

                log.LogInformation($"C# Queue trigger function processed: {item}");
            }
        }
Exemplo n.º 2
0
        public async Task OnDatasetEventFired_SmokeTestSucceeds()
        {
            OnDatasetEvent onDatasetEvent = new OnDatasetEvent(_logger,
                                                               _processDatasetService,
                                                               Services.BuildServiceProvider().GetRequiredService <IMessengerService>(),
                                                               _userProfileProvider,
                                                               IsDevelopment);

            SmokeResponse response = await RunSmokeTest(ServiceBusConstants.QueueNames.ProcessDataset,
                                                        async(Message smokeResponse) => await onDatasetEvent.Run(smokeResponse), useSession : true);

            response
            .Should()
            .NotBeNull();
        }