Exemplo n.º 1
0
        public void TestUnion_EmptySet()
        {
            GenericSet <int> gs1 = new GenericSet <int>();

            for (int i = 1; i <= 8; i++)
            {
                gs1.Add(i);
            }
            Console.WriteLine(gs1);

            GenericSet <int> gs2 = new GenericSet <int>();

            Assert.That(gs2.IsEmpty, Is.True);
            Console.WriteLine(gs2);

            GenericSet <int> union = gs1.Union(gs2);

            Assert.That(union.Size, Is.EqualTo(gs1.Size));
            Assert.That(union.Contains(15), Is.False);
            Assert.That(union.Contains(1), Is.True);
        }