Esempio n. 1
0
        public void TestEquals()
        {
            GenericSet <int> gs1 = new GenericSet <int>();
            GenericSet <int> gs2 = new GenericSet <int>();

            Assert.That(gs1.Equals(gs2), Is.True);

            for (int i = 1; i <= 5; i++)
            {
                gs1.Add(i);
            }
            Console.WriteLine("set1: {0}", gs1);

            for (int i = 5; i >= 1; i--)
            {
                gs2.Add(i);
            }
            Console.WriteLine("set2: {0}", gs2);
            Assert.That(gs1.Equals(gs2), Is.True);
            gs2.Add(10);
            Assert.That(gs1.Equals(gs2), Is.False);
        }