Exemple #1
0
 public void ApplyEvent(StoreEvent evt) {
     GetType()
         .GetMethod("Apply",
                    BindingFlags.NonPublic | BindingFlags.Instance,
                    null, new[] {evt.GetType()}, null)
         .Invoke(this, new object[] {evt});
 }
 protected static void AssertEventNotInStore(StoreEvent expected)
 {
     WaitForNonStaleResults();
     using (var session = Store.OpenSession())
     {
         var events = GetAllPersistedEvents(session);
         Assert.That(events.Count(e => e.Equals(expected)), Is.EqualTo(0));
     }
 }
 protected static void AssertEventInStore(StoreEvent expected)
 {
     WaitForNonStaleResults();
     using (var session = Store.OpenSession())
     {
         var events = GetAllPersistedEvents(session);
         Assert.That(events.Count(), Is.EqualTo(1));
         var evt = events.First();
         Assert.That(evt.Id, Is.EqualTo(expected.Id));
         Assert.That(evt.StreamId, Is.EqualTo(expected.StreamId));
     }
 }
Exemple #4
0
 public void Append(StoreEvent evt)
 {
     evt.StreamRevision = Revision + _pendingEvents.Count + 1;
     _pendingEvents.Add(evt);
 }