Ejemplo n.º 1
0
        public void TestIntersect()
        {
            TopicInfoArray list = new TopicInfoArray();
            TopicInfoArray listToCompare = new TopicInfoArray();

            list.Add(new TopicVersionInfo(Federation, new QualifiedTopicRevision("topicName", "testnamespace")));
            list.Add(new TopicVersionInfo(Federation, new QualifiedTopicRevision("topic3", "testnamespace")));
            list.Add(new TopicVersionInfo(Federation, new QualifiedTopicRevision("topic1", "testnamespace")));
            list.Add(new TopicVersionInfo(Federation, new QualifiedTopicRevision("topic4", "testnamespace")));

            listToCompare.Add(new TopicVersionInfo(Federation, new QualifiedTopicRevision("topicName", "testnamespace")));
            listToCompare.Add(new TopicVersionInfo(Federation, new QualifiedTopicRevision("topic3", "testnamespace")));
            listToCompare.Add(new TopicVersionInfo(Federation, new QualifiedTopicRevision("topic1", "testnamespace")));
            listToCompare.Add(new TopicVersionInfo(Federation, new QualifiedTopicRevision("topic2", "testnamespace")));
            listToCompare.Add(new TopicVersionInfo(Federation, new QualifiedTopicRevision("topic5", "testnamespace")));
            listToCompare.Add(new TopicVersionInfo(Federation, new QualifiedTopicRevision("topic6", "testnamespace")));
            listToCompare.Add(new TopicVersionInfo(Federation, new QualifiedTopicRevision("topic7", "testnamespace")));

            Assert.AreEqual(3, list.Intersect(listToCompare.Array).Count, "Comparing number of elements in list and listToCompare after Intersect");

        }