コード例 #1
0
 public void When()
 {
     _publishWithCorrelationId      = Guid.NewGuid();
     _distibutionPointCorrelationId = Guid.NewGuid();
     _edp = new StreamReaderEventDistributionPoint(_bus, _distibutionPointCorrelationId, "stream", 10, false);
     _edp.Resume();
     _firstEventId  = Guid.NewGuid();
     _secondEventId = Guid.NewGuid();
     _edp.Handle(
         new ClientMessage.ReadStreamEventsForwardCompleted(
             _distibutionPointCorrelationId, "stream",
             new[]
     {
         new EventLinkPair(
             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 EventLinkPair(
             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)
     }, RangeReadResult.Success, 12, 11, true, 200));
     _edp.Handle(
         new ClientMessage.ReadStreamEventsForwardCompleted(
             _distibutionPointCorrelationId, "stream",
             new EventLinkPair[] { }, RangeReadResult.Success, 12, 11, true, 400));
 }
コード例 #2
0
 public void cannot_handle_repeated_read_events_completed()
 {
     _edp.Handle(
         new ClientMessage.ReadEventsForwardCompleted(
             _distibutionPointCorrelationId, "stream",
             new[]
     {
         new EventRecord(
             10, 50, Guid.NewGuid(), Guid.NewGuid(), 50, "stream", ExpectedVersion.Any, DateTime.UtcNow,
             PrepareFlags.SingleWrite | PrepareFlags.TransactionBegin | PrepareFlags.TransactionEnd,
             "event_type", new byte[0], new byte[0])
     }, null, RangeReadResult.Success, 11, 100));
 }
コード例 #3
0
 public void When()
 {
     _publishWithCorrelationId      = Guid.NewGuid();
     _distibutionPointCorrelationId = Guid.NewGuid();
     _edp = new StreamReaderEventDistributionPoint(_bus, _distibutionPointCorrelationId, "stream", 0, false);
     _edp.Resume();
     _firstEventId  = Guid.NewGuid();
     _secondEventId = Guid.NewGuid();
     _edp.Handle(
         new ClientMessage.ReadStreamEventsForwardCompleted(
             _distibutionPointCorrelationId, "stream",
             new EventLinkPair[0], RangeReadResult.NoStream, -1, ExpectedVersion.NoStream, false, 200));
 }
コード例 #4
0
 public void handle_read_events_completed_throws()
 {
     _edp.Handle(
         new ClientMessage.ReadEventsForwardCompleted(
             _distibutionPointCorrelationId, "stream", new EventRecord[0], null, RangeReadResult.Success, -1, 100));
 }
 public void handle_read_events_completed_throws()
 {
     _edp.Handle(
         new ClientMessage.ReadStreamEventsForwardCompleted(
             _distibutionPointCorrelationId, "stream", new EventLinkPair[0], RangeReadResult.Success, -1, 4, false, 100));
 }