Example #1
0
        public static void AssertDeltaPath(IEventRegistry blob, int[] path)
        {
            EventSourceRoot root = AssertGenerated(blob);

            AssertPath(root.Events[0], path);
            blob.ClearEvents();
        }
Example #2
0
        public static EventSourceRoot AssertGenerated(IEventRegistry blob)
        {
            EventSourceRoot root = blob.PeekEvents();

            Assert.Single(root.Events);
            return(root);
        }
        /// <summary>
        /// Returns the existing set of events, this does not clear the events associated with the messages
        /// </summary>
        /// <returns></returns>
        public EventSourceRoot GenerateEvents()
        {
            var er = new EventSourceRoot();

            er.Events.AddRange(Context.Events);
            return(er);
        }
 /// <summary>
 /// Takes a set of events and applies them to the Message
 /// </summary>
 /// <param name="root"></param>
 public void ApplyEvents(EventSourceRoot root)
 {
     foreach (var e in root.Events)
     {
         ApplyEvent(e, 0);
     }
 }
Example #5
0
        /// <summary>
        /// Returns the existing set of events, this does not clear the events associated with the messages
        /// </summary>
        /// <returns></returns>
        public EventSourceRoot PeekEvents()
        {
            var er = new EventSourceRoot();

            if (Context.Events != null)
            {
                er.Events.AddRange(Context.Events);
            }
            return(er);
        }
Example #6
0
 /// <summary>
 /// Takes a set of events and applies them to the Message
 /// </summary>
 /// <param name="root"></param>
 public void ApplyEvents(EventSourceRoot root)
 {
     foreach (var e in root.Events)
     {
         try {
             ApplyEvent(e, 0);
         }
         catch (Exception ex) {
             throw new ApplyEventException(e, ex);
         }
     }
 }
Example #7
0
        public static void AssertNotGenerated(IEventRegistry blob)
        {
            EventSourceRoot root = blob.PeekEvents();

            Assert.Empty(root.Events);
        }