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); }
public async Task EnqueueAsync(ProviderQueueItem item, CancellationToken cancellationToken) { await _queue.AddMessageAsync(new CloudQueueMessage(JsonSerializer.Serialize(item)), cancellationToken); }