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();
     _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,
                 "event_type2", new byte[] { 3 }, new byte[] { 4 }), null)
     }, null, false, "", 12, 11, true, 200));
     _edp.Pause();
     _edp.Handle(
         new ClientMessage.ReadStreamEventsForwardCompleted(
             _distibutionPointCorrelationId, "stream", 100, 100, ReadStreamResult.Success, new ResolvedEvent[0]
             , null, false, "", 12, 11, true, 400));
 }
 public new void When()
 {
     _distibutionPointCorrelationId = Guid.NewGuid();
     _edp = new StreamEventReader(_bus, _distibutionPointCorrelationId, null, "stream", 0, new RealTimeProvider(), false,
                                  produceStreamDeletes: false);
     _edp.Resume();
     _edp.Pause();
     _edp.Handle(
         new ClientMessage.ReadStreamEventsForwardCompleted(
             _distibutionPointCorrelationId, "stream", 100, 100, ReadStreamResult.NoStream, new ResolvedEvent[0]
             , null, false, "", -1, ExpectedVersion.NoStream, true, 200));
 }
Ejemplo n.º 3
0
 public void cannot_be_paused()
 {
     _edp.Pause();
 }
 public void it_cannot_be_paused()
 {
     Assert.Throws <InvalidOperationException>(() => { _edp.Pause(); });
 }