bool AreTheSame(FindEventResult ev1, TopicInfo topic1, FindEventResult ev2, XmlElement element2)
        {
            bool scopeMatches = (ev1.Time == ev2.Time) && (ev2.RecordingToken == ev1.RecordingToken) &&
                                (ev1.TrackToken == ev2.TrackToken);

            bool topicMatches = false;

            if (scopeMatches)
            {
                TopicInfo t2 = CreateTopicInfo(ev2, element2);
                topicMatches = TopicInfo.TopicsMatch(topic1, t2);
            }

            return(topicMatches);
        }
        bool CheckEventTopic(FindEventResult e, XmlElement rawResultElement,
                             string topic,
                             string ns)
        {
            if (e.Event != null && e.Event.Topic != null)
            {
                TopicInfo expected =
                    TopicInfo.ConstructTopicInfo(new EventsTopicInfo()
                {
                    NamespacesDefinition = ns, Topic = topic
                });

                TopicInfo actual = CreateTopicInfo(e, rawResultElement);

                bool topicMatches = TopicInfo.TopicsMatch(actual, expected);

                return(topicMatches);
            }
            return(false);
        }
        bool AreTheSame(FindEventResult ev1, TopicInfo topic1, FindEventResult ev2, XmlElement element2)
        {
            // Two Event Results will be assumed as the same, if they have the same values for
            // GetEventSearchResultsResponse.ResultList.Result.RecordingToken,
            // GetEventSearchResultsResponse.ResultList.Result.TrackToken,
            // GetEventSearchResultsResponse.ResultList.Result.Time,
            // GetEventSearchResultsResponse.ResultList.Result.Event.Topic and
            // fields and values of GetEventSearchResultsResponse.ResultList.Result.Event.Message.Data.

            bool scopeMatches = (ev1.Time == ev2.Time) && (ev2.RecordingToken == ev1.RecordingToken) &&
                                (ev1.TrackToken == ev2.TrackToken);

            bool topicMatches = false;

            if (scopeMatches)
            {
                TopicInfo t2 = CreateTopicInfo(ev2, element2);
                topicMatches = TopicInfo.TopicsMatch(topic1, t2);
            }

            return(topicMatches);
        }