Exemplo n.º 1
0
        public void SetUp()
        {
            _eventProjectionMock            = new Mock <IEventProjection>(MockBehavior.Strict);
            _projectionPipelineModuleConfig = new ProjectionPipelineModuleConfig(
                _eventProjectionMock.Object
                );

            _projectionPipelineModule = new ProjectionPipelineModule();
        }
        public void ThenIsProjected_ShouldAddPipelineModule()
        {
            ProjectionPipelineModuleConfig config = null;

            SetUpPipeline(callbackConfig => config = callbackConfig);

            var newEventPipelineConfigurator = _eventPipelineConfigurator.ThenIsProjected(x => new ProjectedEvent());

            Assert.That(
                newEventPipelineConfigurator,
                Is.TypeOf <EventPipelineConfigurator <ProjectedEvent> >()
                );

            Assert.That(config, Has.Property(nameof(ProjectionPipelineModuleConfig.EventProjection)).Not.Null);
            Assert.That(newEventPipelineConfigurator.Get <IServiceProvider>(), Is.EqualTo(_serviceProviderMock.Object));
            Assert.That(newEventPipelineConfigurator.Get <IPipeline>(), Is.EqualTo(_pipelineMock.Object));
        }