Пример #1
0
        public void IntersectShouldWorkProperly()
        {
            var firstSet = new CustomHashSet<string> { "Perl", "Java", "C#", "SQL", "PHP" };
            var secondSet = new CustomHashSet<string> { "Oracle", "SQL", "MySQL" };
            var union = firstSet.IntersectWith(secondSet);

            Assert.AreEqual("SQL", union.ToString());
        }
Пример #2
0
        public void IntersectShouldWorkProperly()
        {
            var firstSet = new CustomHashSet <string> {
                "Perl", "Java", "C#", "SQL", "PHP"
            };
            var secondSet = new CustomHashSet <string> {
                "Oracle", "SQL", "MySQL"
            };
            var union = firstSet.IntersectWith(secondSet);

            Assert.AreEqual("SQL", union.ToString());
        }
Пример #3
0
        private static void DisplayUnionIntersect(CustomHashSet <string> firstSet, CustomHashSet <string> secondSet)
        {
            Console.Write("First set: ");
            PrintSet(firstSet);

            Console.Write("Second set: ");
            PrintSet(secondSet);

            var union = firstSet.UnionWith(secondSet);

            Console.Write("Union: ");
            PrintSet(union);

            var intersect = firstSet.IntersectWith(secondSet);

            Console.Write("Intersect: ");
            PrintSet(intersect);
        }