示例#1
0
        public async Task ThenItShouldProcessProviderQueueItem()
        {
            var cancellationToken = new CancellationToken();
            var queueItem         = new ProviderQueueItem
            {
                AcademicYear = "2021",
                Ukprn        = 12345678,
            };

            await _function.RunAsync(
                new CloudQueueMessage(JsonSerializer.Serialize(queueItem)),
                cancellationToken);

            _changeProcessorMock.Verify(processor => processor.ProcessProviderAsync(
                                            queueItem.AcademicYear,
                                            queueItem.Ukprn,
                                            cancellationToken),
                                        Times.Once);
        }
 public Task EnqueueAsync(ProviderQueueItem item, CancellationToken cancellationToken)
 {
     _queue.Enqueue(item);
     return(Task.CompletedTask);
 }
示例#3
0
 public async Task EnqueueAsync(ProviderQueueItem item, CancellationToken cancellationToken)
 {
     await _queue.AddMessageAsync(new CloudQueueMessage(JsonSerializer.Serialize(item)), cancellationToken);
 }