示例#1
0
        public new void When()
        {
            _distibutionPointCorrelationId = Guid.NewGuid();
            _edp = new StreamEventReader(_bus, _distibutionPointCorrelationId, null, "stream", 10, new RealTimeProvider(), false,
                                         produceStreamDeletes: false);
            _edp.Resume();
            _firstEventId  = Guid.NewGuid();
            _secondEventId = Guid.NewGuid();
            var correlationId = _consumer.HandledMessages.OfType <ClientMessage.ReadStreamEventsForward>().Last().CorrelationId;

            _edp.Handle(
                new ClientMessage.ReadStreamEventsForwardCompleted(
                    correlationId, "stream", 100, 100, ReadStreamResult.Success,
                    new[]
            {
                ResolvedEvent.ForUnresolvedEvent(
                    new EventRecord(
                        10, 50, Guid.NewGuid(), _firstEventId, 50, 0, "stream", ExpectedVersion.Any, DateTime.UtcNow,
                        PrepareFlags.SingleWrite | PrepareFlags.TransactionBegin | PrepareFlags.TransactionEnd,
                        "event_type1", new byte[] { 1 }, new byte[] { 2 })),
                ResolvedEvent.ForUnresolvedEvent(
                    new EventRecord(
                        11, 100, Guid.NewGuid(), _secondEventId, 100, 0, "stream", ExpectedVersion.Any,
                        DateTime.UtcNow,
                        PrepareFlags.SingleWrite | PrepareFlags.TransactionBegin | PrepareFlags.TransactionEnd,
                        "event_type2", new byte[] { 3 }, new byte[] { 4 }))
            }, null, false, "", 12, 11, true, 200));
            correlationId = _consumer.HandledMessages.OfType <ClientMessage.ReadStreamEventsForward>().Last().CorrelationId;
            _edp.Handle(
                new ClientMessage.ReadStreamEventsForwardCompleted(
                    correlationId, "stream", 100, 100, ReadStreamResult.Success, new ResolvedEvent[0]
                    , null, false, "", 12, 11, true, 400));
        }
示例#2
0
 public new void When()
 {
     _distibutionPointCorrelationId = Guid.NewGuid();
     _edp = new StreamEventReader(_bus, _distibutionPointCorrelationId, null, "stream", 10, new RealTimeProvider(), false,
                                  produceStreamDeletes: false);
     _edp.Resume();
 }
示例#3
0
 public new void When()
 {
     //_publishWithCorrelationId = Guid.NewGuid();
     _distibutionPointCorrelationId = Guid.NewGuid();
     _edp = new StreamEventReader(
         _bus, _distibutionPointCorrelationId, null, "stream", 0, new RealTimeProvider(), false);
 }
 public new void When()
 {
     _publishWithCorrelationId      = Guid.NewGuid();
     _distibutionPointCorrelationId = Guid.NewGuid();
     _edp = new StreamEventReader(
         _ioDispatcher, _bus, _distibutionPointCorrelationId, null, "stream", 10, new RealTimeProvider(), false,
         produceStreamDeletes: false);
     _edp.Resume();
     _firstEventId  = Guid.NewGuid();
     _secondEventId = Guid.NewGuid();
     _edp.Handle(
         new ClientMessage.ReadStreamEventsForwardCompleted(
             _distibutionPointCorrelationId, "stream", 100, 100, ReadStreamResult.Success,
             new[]
     {
         new ResolvedEvent(
             new EventRecord(
                 10, 50, Guid.NewGuid(), _firstEventId, 50, 0, "stream", ExpectedVersion.Any, DateTime.UtcNow,
                 PrepareFlags.SingleWrite | PrepareFlags.TransactionBegin | PrepareFlags.TransactionEnd,
                 "event_type1", new byte[] { 1 }, new byte[] { 2 }), null),
         new ResolvedEvent(
             new EventRecord(
                 11, 100, Guid.NewGuid(), _secondEventId, 100, 0, "stream", ExpectedVersion.Any,
                 DateTime.UtcNow,
                 PrepareFlags.SingleWrite | PrepareFlags.TransactionBegin | PrepareFlags.TransactionEnd | PrepareFlags.IsJson,
                 "event_type2", new byte[] { 3 }, new byte[] { 4 }), null)
     }, null, false, "", 12, 11, true, 200));
 }
        public new void When()
        {
            _distributionCorrelationId = Guid.NewGuid();
            _fakeTimeProvider          = new FakeTimeProvider();
            _eventReader = new StreamEventReader(_bus, _distributionCorrelationId, null, "stream", 10, _fakeTimeProvider,
                                                 resolveLinkTos: false, stopOnEof: true, produceStreamDeletes: false);
            _eventReader.Resume();
            var correlationId = _consumer.HandledMessages.OfType <ClientMessage.ReadStreamEventsForward>().Last().CorrelationId;

            _eventReader.Handle(
                new ClientMessage.ReadStreamEventsForwardCompleted(
                    correlationId, "stream", 100, 100, ReadStreamResult.Success,
                    new[]
            {
                ResolvedEvent.ForUnresolvedEvent(
                    new EventRecord(
                        10, 50, Guid.NewGuid(), Guid.NewGuid(), 50, 0, "stream", ExpectedVersion.Any, DateTime.UtcNow,
                        PrepareFlags.SingleWrite | PrepareFlags.TransactionBegin | PrepareFlags.TransactionEnd,
                        "event_type1", new byte[] { 1 }, new byte[] { 2 })),
                ResolvedEvent.ForUnresolvedEvent(
                    new EventRecord(
                        11, 100, Guid.NewGuid(), Guid.NewGuid(), 100, 0, "stream", ExpectedVersion.Any,
                        DateTime.UtcNow,
                        PrepareFlags.SingleWrite | PrepareFlags.TransactionBegin | PrepareFlags.TransactionEnd,
                        "event_type2", new byte[] { 3 }, new byte[] { 4 }))
            }, null, false, "", 12, 11, true, 200));
            _eventReader.Handle(
                new ProjectionManagementMessage.Internal.ReadTimeout(correlationId, "stream"));
        }
示例#6
0
 public new void When()
 {
     _distibutionPointCorrelationId = Guid.NewGuid();
     _fakeTimeProvider = new FakeTimeProvider();
     _edp = new StreamEventReader(_bus, _distibutionPointCorrelationId, null, _streamName, _fromSequenceNumber, _fakeTimeProvider, false, produceStreamDeletes: false);
     _edp.Resume();
 }
示例#7
0
 public new void When()
 {
     _edp = new StreamEventReader(_bus, Guid.NewGuid(), null, _streamName, _fromSequenceNumber,
                                  new RealTimeProvider(), false,
                                  produceStreamDeletes: false);
     _edp.Resume();
 }
 public new void When()
 {
     //_publishWithCorrelationId = Guid.NewGuid();
     _distibutionPointCorrelationId = Guid.NewGuid();
     _edp = new StreamEventReader(
         _ioDispatcher, _bus, _distibutionPointCorrelationId, null, "stream", 0, new RealTimeProvider(), false,
         produceStreamDeletes: false);
 }
示例#9
0
        protected override void Given()
        {
            TicksAreHandledImmediately();

            _distibutionPointCorrelationId = Guid.NewGuid();
            _streamEventReader             = new StreamEventReader(_bus, _distibutionPointCorrelationId, null, _streamId, 0, new RealTimeProvider(), false,
                                                                   produceStreamDeletes: false);
            _streamEventReader.Resume();
            _firstEventId  = Guid.NewGuid();
            _secondEventId = Guid.NewGuid();
        }
示例#10
0
 public new void When()
 {
     _distibutionPointCorrelationId = Guid.NewGuid();
     _edp = new StreamEventReader(_bus, _distibutionPointCorrelationId, null, "stream", 0, new RealTimeProvider(), false,
                                  produceStreamDeletes: false);
     _edp.Resume();
     _edp.Handle(
         new ClientMessage.ReadStreamEventsForwardCompleted(
             _distibutionPointCorrelationId, "stream", 100, 100,
             ReadStreamResult.NoStream, new ResolvedEvent[0], null, false, "", -1, ExpectedVersion.NoStream, true, 200));
 }