Example #1
0
        /// <summary>
        /// Checks that there are <paramref name="expected"/> events present.
        /// Includes a message with context info to help track the possible issue.
        /// </summary>
        public static IEnumerable <ErrorEvent> VerifyMany(ErrorEventEntryPolling polling, string contextInfo, int expected)
        {
            var events = polling.GetEvents(contextInfo, expected);

            Assert.True(expected == events.Count(), $"Should have found {expected} entries for contest {contextInfo} but found {events.Count()}");
            return(events);
        }
Example #2
0
        /// <summary>
        /// Checks that there's only one event present.
        /// Includes a message with context info to help track the possible issue.
        /// </summary>
        public static ErrorEvent VerifySingle(ErrorEventEntryPolling polling, string contextInfo)
        {
            var events     = polling.GetEvents(contextInfo, 1);
            var errorEvent = events.SingleOrDefault();

            Assert.True(errorEvent != null, $"No entries found for context {contextInfo}");
            return(errorEvent);
        }