Exemple #1
0
 public static void ShouldBeTheSameAs(this CommittedEvent committedEvent, Events.Event storedEvent)
 {
     committedEvent.Content.ShouldEqual(storedEvent.Content.ToString());
     committedEvent.EventLogSequenceNumber.Value.ShouldEqual(storedEvent.EventLogSequenceNumber);
     committedEvent.EventSource.Value.ShouldEqual(storedEvent.Metadata.EventSource);
     committedEvent.ExecutionContext.ShouldBeTheSameAs(storedEvent.ExecutionContext);
     committedEvent.Occurred.UtcDateTime.ShouldEqual(storedEvent.Metadata.Occurred);
     committedEvent.Public.ShouldEqual(storedEvent.Metadata.Public);
     committedEvent.Type.Id.Value.ShouldEqual(storedEvent.Metadata.TypeId);
     committedEvent.Type.Generation.Value.ShouldEqual(storedEvent.Metadata.TypeGeneration);
 }
Exemple #2
0
 static void should_be_the_same_base_committed_event(IEventContentConverter event_content_converter, CommittedEvent committed_event, Event stored_event)
 {
     JToken.DeepEquals(JToken.Parse(event_content_converter.ToJson(stored_event.Content)), JToken.Parse(committed_event.Content)).ShouldBeTrue();
     stored_event.Metadata.Occurred.ShouldBeCloseTo(committed_event.Occurred.UtcDateTime, TimeSpan.FromSeconds(1));
     stored_event.Metadata.Public.ShouldEqual(committed_event.Public);
     stored_event.Metadata.EventSource.ShouldEqual(committed_event.EventSource.Value);
     stored_event.Metadata.TypeGeneration.ShouldEqual(committed_event.Type.Generation.Value);
     stored_event.Metadata.TypeId.ShouldEqual(committed_event.Type.Id.Value);
     should_have_same_execution_context(committed_event.ExecutionContext, stored_event.ExecutionContext);
     stored_event.EventLogSequenceNumber.ShouldEqual(committed_event.EventLogSequenceNumber.Value);
 }
Exemple #3
0
 /// <inheritdoc/>
 public runtime.Streams.StreamEvent ToRuntimeStreamEvent(mongoDB.Event @event) =>
 new runtime.Streams.StreamEvent(@event.ToCommittedEvent(), @event.EventLogSequenceNumber, StreamId.EventLog, Guid.Empty, false);
Exemple #4
0
 public static void ShouldBeTheSameAs(this CommittedAggregateEvent committedEvent, Events.Event storedEvent)
 {
     (committedEvent as CommittedEvent).ShouldBeTheSameAs(storedEvent);
     committedEvent.AggregateRoot.Id.Value.ShouldEqual(storedEvent.Aggregate.TypeId);
     committedEvent.AggregateRoot.Generation.Value.ShouldEqual(storedEvent.Aggregate.TypeGeneration);
     committedEvent.AggregateRootVersion.Value.ShouldEqual(storedEvent.Aggregate.Version);
 }