public override Task ExecuteAsync(string receiver, WebHookHandlerContext context) { if (!receiver.Equals("GitHub", StringComparison.CurrentCultureIgnoreCase)) { return(Task.FromResult(true)); } var eventProcessorService = new EventProcessorService(); eventProcessorService.Process(context.Actions, context.Data); return(Task.FromResult(true)); }
public async Task ExecuteAsync_Calls_EventQueueProcessor() { var service = new EventProcessorService( _loggerMock.Object, _eventQueueProcessorMock.Object, _optionsMock.Object); await service.StartAsync(CancellationToken.None); // A little delay to ensure we don't request cancellation // before first loop has run once (test stability). await Task.Delay( 250, CancellationToken.None); await service.StopAsync(CancellationToken.None); _eventQueueProcessorMock.Verify( x => x.ProcessQueueAsync(It.IsAny <CancellationToken>()), Times.AtLeastOnce); }