private IEnumerable <MxHostTestDetails> FilterHosts(MxHostTestDetails host) { var hostname = host.Test.Id; using (_log.BeginScope(new Dictionary <string, object> { [TlsHostLogPropertyName] = hostname })) { if (_processingFilter.Reserve(hostname)) { yield return(host); } } }
public async Task NoProfileToProcessNoProcessingOccurs() { A.CallTo(() => _mxQueueProcessor.GetMxHosts()) .Returns(Task.FromResult(new List <TlsTestPending>())); Task process = _mxSecurityTesterProcessor.Process(cancellationTokenSource.Token); await _pipelineStartBlock.SendAsync(null); cancellationTokenSource.Cancel(); await process; A.CallTo(() => _mxQueueProcessor.GetMxHosts()).MustHaveHappenedOnceExactly(); A.CallTo(() => _mxHostTester.Test(A <TlsTestPending> ._)).MustNotHaveHappened(); A.CallTo(() => _publisher.Publish(A <Message> ._, A <string> ._)).MustNotHaveHappened(); A.CallTo(() => _mxQueueProcessor.DeleteMessage(A <string> ._, A <string> ._)).MustNotHaveHappened(); A.CallTo(() => _processingFilter.Reserve(A <string> ._)).MustNotHaveHappened(); A.CallTo(() => _processingFilter.ReleaseReservation(A <string> ._)).MustNotHaveHappened(); }