public void setup()
 {
     _zeroEvent = new ProjectionCoreServiceMessage.CommittedEventDistributed(Guid.NewGuid(), new EventPosition(10, 0), "stream1", 0, false, ResolvedEvent.Sample(Guid.NewGuid(), "StreamCreated", false, new byte[0], new byte[0]));
     _firstEvent = new ProjectionCoreServiceMessage.CommittedEventDistributed(Guid.NewGuid(), new EventPosition(30, 20), "stream1", 1, false, ResolvedEvent.Sample(Guid.NewGuid(), "Data", true, Encoding.UTF8.GetBytes("{}"), new byte[0]));
     _secondEvent = new ProjectionCoreServiceMessage.CommittedEventDistributed(Guid.NewGuid(), new EventPosition(50, 40), "stream2", 0, false, ResolvedEvent.Sample(Guid.NewGuid(), "StreamCreated", false, new byte[0], new byte[0]));
     _thirdEvent = new ProjectionCoreServiceMessage.CommittedEventDistributed(Guid.NewGuid(), new EventPosition(70, 60), "stream2", 1, false, ResolvedEvent.Sample(Guid.NewGuid(), "Data", true, Encoding.UTF8.GetBytes("{}"), new byte[0]));
 }
Esempio n. 2
0
 public static CommittedEventReceived FromCommittedEventDistributed(
     ProjectionCoreServiceMessage.CommittedEventDistributed message, CheckpointTag checkpointTag,
     string eventCategory, long subscriptionMessageSequenceNumber)
 {
     return(new CommittedEventReceived(
                message.CorrelationId, message.Position, checkpointTag, message.PositionStreamId,
                message.PositionSequenceNumber, message.EventStreamId, message.EventSequenceNumber, eventCategory,
                message.ResolvedLinkTo, message.Data, message.Progress, subscriptionMessageSequenceNumber));
 }
 protected void SendPrerecordedEvent(
     EventStore.Core.Data.ResolvedEvent pair, CheckpointTag positionTag, long prerecordedEventMessageSequenceNumber)
 {
     var position = pair.OriginalEvent;
     var committedEvent = new ProjectionCoreServiceMessage.CommittedEventDistributed(
         Guid.Empty, default(EventPosition), position.EventStreamId, position.EventNumber,
         pair.Event.EventStreamId, pair.Event.EventNumber, pair.Link != null,
         ResolvedEvent.Create(
             pair.Event.EventId, pair.Event.EventType, (pair.Event.Flags & PrepareFlags.IsJson) != 0,
             pair.Event.Data, pair.Event.Metadata, pair.Event.TimeStamp), null, -1);
     _coreProjection.Handle(
         ProjectionSubscriptionMessage.CommittedEventReceived.FromCommittedEventDistributed(
             committedEvent, positionTag, null, Guid.Empty, prerecordedEventMessageSequenceNumber));
 }