public void ThenIsQueuedTo_ShouldAddPipelineModule()
        {
            _pipelineMock
            .Setup(x => x.AddModule <EnqueuePipelineModule, EnqueuePipelineModuleConfig>(
                       It.Is <EnqueuePipelineModuleConfig>(y => y.QueueName == QueueName)
                       )
                   )
            .Verifiable();

            _serviceProviderMock
            .Setup(x => x.GetService(typeof(IEventsQueueNamesService)))
            .Returns(_eventsQueueNamesServiceMock.Object)
            .Verifiable();

            _eventsQueueNamesServiceMock
            .Setup(x => x.RegisterQueueNameIfNotExists(QueueName))
            .Verifiable();

            _eventPipelineConfigurator.ThenIsQueuedTo(QueueName);
        }
示例#2
0
            private void ContinueConfiguration <TEvent>(
                EventPipelineConfigurator <TEvent> pipelineConfigurator
                )
                where TEvent : class
            {
                if (_parameters.IsQueued)
                {
                    pipelineConfigurator.ThenIsQueuedTo("DefaultQueue");
                }

                switch (_parameters.PublicationType)
                {
                case PublicationType.GlobalWithServiceHandlerSubscription:
                    pipelineConfigurator.ThenIsPublishedToGlobalSubscriptions();
                    break;

                case PublicationType.ScopedWithServiceHandlerSubscription:
                    pipelineConfigurator.ThenIsPublishedToScopedSubscriptions();
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }
            }