Example #1
0
        private static EventDistributionPoint CreatePausedStreamReaderEventDistributionPoint(
            Guid distributionPointId, IPublisher publisher, IPublisher inputQueue, CheckpointTag checkpointTag,
            string streamName, bool resolveLinkTos, string category)
        {
            var lastProcessedSequenceNumber = checkpointTag.Streams.Values.First();
            var fromSequenceNumber          = lastProcessedSequenceNumber + 1;
            var distributionPoint           = new StreamReaderEventDistributionPoint(
                publisher, distributionPointId, streamName, fromSequenceNumber, resolveLinkTos);

            return(distributionPoint);
        }
 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));
 }
 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.ReadEventsForwardCompleted(
             _distibutionPointCorrelationId, "stream",
             new[]
                 {
                     new EventRecord(
                 10, 50, Guid.NewGuid(), _firstEventId, 50, "stream", ExpectedVersion.Any, DateTime.UtcNow,
                 PrepareFlags.SingleWrite | PrepareFlags.TransactionBegin | PrepareFlags.TransactionEnd,
                 "event_type1", new byte[] {1}, new byte[] {2}),
                     new EventRecord(
                 11, 100, Guid.NewGuid(), _secondEventId, 100, "stream", ExpectedVersion.Any, DateTime.UtcNow,
                 PrepareFlags.SingleWrite | PrepareFlags.TransactionBegin | PrepareFlags.TransactionEnd,
                 "event_type2", new byte[] {3}, new byte[] {4})
                 }, null, RangeReadResult.Success, 12, 200));
 }
 public void When()
 {
     _publishWithCorrelationId = Guid.NewGuid();
     _distibutionPointCorrelationId = Guid.NewGuid();
     _edp = new StreamReaderEventDistributionPoint(_bus, _distibutionPointCorrelationId, "stream", 0, false);
 }
 private static EventDistributionPoint CreatePausedStreamReaderEventDistributionPoint(Guid distributionPointId, IPublisher publisher, CheckpointTag checkpointTag,
     string streamName, bool resolveLinkTos, string category)
 {
     var lastProcessedSequenceNumber = checkpointTag.Streams.Values.First();
     var fromSequenceNumber = lastProcessedSequenceNumber + 1;
     var distributionPoint = new StreamReaderEventDistributionPoint(
         publisher, distributionPointId, streamName, fromSequenceNumber, resolveLinkTos,
         category);
     return distributionPoint;
 }
 public void null_stream_name_throws_argument_null_exception()
 {
     var edp = new StreamReaderEventDistributionPoint(_bus, Guid.NewGuid(), null, 0, false);
 }
 public void null_publisher_throws_argument_null_exception()
 {
     var edp = new StreamReaderEventDistributionPoint(null, Guid.NewGuid(), "stream", 0, false);
 }
 public void negative_event_sequence_number_throws_argument_exception()
 {
     var edp = new StreamReaderEventDistributionPoint(_bus, Guid.NewGuid(), "", -1, false);
 }
 public void it_can_be_created()
 {
     var edp = new StreamReaderEventDistributionPoint(_bus, Guid.NewGuid(), "stream", 0, false);
 }
 public void empty_distribution_point_id_throws_argument_exception()
 {
     var edp = new StreamReaderEventDistributionPoint(_bus, Guid.Empty, "stream", 0, false);
 }