示例#1
0
        public void ShouldNotExecuteWhenForEventsNotInterestedIn(
            Subject<IEvent> source, FakeDocumentWriter writer, NotInterestedInThis @event)
        {
            writer.DB.Clear();

            new DocumentWriterProjection<ListOfProjectedState>(
                source, writer, () => new ListOfProjectedState())
                .When<TestEvent>((e, s) =>
                                 s.AddState(
                                     new TestProjectionState(e.SomeState)),
                                 e => e.Id);

            source.OnNext(@event);

            writer.DB.Select(x => x.Value).ShouldBeEmpty();
        }
示例#2
0
        public void ShouldNotExecuteWhenForEventsNotInterestedIn(
            Subject <IEvent> source, FakeDocumentWriter writer, NotInterestedInThis @event)
        {
            writer.DB.Clear();

            new DocumentWriterProjection <ListOfProjectedState>(
                source, writer, () => new ListOfProjectedState())
            .When <TestEvent>((e, s) =>
                              s.AddState(
                                  new TestProjectionState(e.SomeState)),
                              e => e.Id);

            source.OnNext(@event);

            writer.DB.Select(x => x.Value).ShouldBeEmpty();
        }