示例#1
0
        public async Task CallsProcessValidationOutcome()
        {
            var handler = CreateHandler();
            await handler.HandleAsync(MessageData);

            ValidationOutcomeProcessorMock
            .Verify(vop => vop.ProcessValidationOutcomeAsync(ValidationSet, SymbolPackageValidatingEntity, It.IsAny <ValidationSetProcessorResult>()));
        }
        public async Task CallsProcessValidationOutcome()
        {
            var handler = CreateHandler();
            await handler.HandleAsync(MessageData);

            ValidationOutcomeProcessorMock
            .Verify(vop => vop.ProcessValidationOutcomeAsync(ValidationSet, Package));
        }
示例#3
0
        public async Task AbandonsMessageProcessingIfShutdownIsInProgress()
        {
            var cancellationTokenSource = new CancellationTokenSource();

            ShutdownNotificationTokenProviderMock
            .SetupGet(x => x.Token)
            .Returns(cancellationTokenSource.Token);
            cancellationTokenSource.Cancel();

            var handler = CreateHandler();
            var result  = await handler.HandleAsync(MessageData);

            Assert.False(result);
            CorePackageServiceMock
            .Verify(cps => cps.FindPackageByIdAndVersionStrict(It.IsAny <string>(), It.IsAny <string>()), Times.Never());
            ValidationSetProviderMock
            .Verify(vsp => vsp.GetOrCreateValidationSetAsync(It.IsAny <Guid>(), It.IsAny <Package>()), Times.Never());
            ValidationSetProcessorMock
            .Verify(vsp => vsp.ProcessValidationsAsync(It.IsAny <PackageValidationSet>(), It.IsAny <Package>()), Times.Never());
            ValidationOutcomeProcessorMock
            .Verify(vop => vop.ProcessValidationOutcomeAsync(It.IsAny <PackageValidationSet>(), It.IsAny <Package>()), Times.Never());
        }