private void AssertEvents(BsonArray eventItems, UnifiedEntityMap entityMap)
        {
            var unifiedEventMatcher = new UnifiedEventMatcher(new UnifiedValueMatcher(entityMap));

            foreach (var eventItem in eventItems)
            {
                var clientId      = eventItem["client"].AsString;
                var eventCapturer = entityMap.EventCapturers[clientId];
                var actualEvents  = eventCapturer.Events;

                unifiedEventMatcher.AssertEventsMatch(actualEvents, eventItem["events"].AsBsonArray);
            }
        }
        private void AssertEvents(BsonArray eventItems, UnifiedEntityMap entityMap)
        {
            var unifiedEventMatcher = new UnifiedEventMatcher(new UnifiedValueMatcher(entityMap));

            foreach (var eventItem in eventItems.Cast <BsonDocument>())
            {
                var clientId      = eventItem["client"].AsString;
                var eventCapturer = entityMap.EventCapturers[clientId];
                var eventType     = eventItem.GetValue("eventType", defaultValue: "command").AsString;
                var actualEvents  = UnifiedEventMatcher.FilterEventsByType(eventCapturer.Events, eventType);

                unifiedEventMatcher.AssertEventsMatch(actualEvents, eventItem["events"].AsBsonArray);
            }
        }