Esempio n. 1
0
        public void SymmetricExceptWithTest()
        {
            var someSet = new GenericSet <string>();

            set.Add("1");
            set.Add("2");
            set.Add("3");
            set.Add("4");
            set.Add("5");
            someSet.Add("1");
            someSet.Add("2");
            someSet.Add("3");
            someSet.Add("4");
            someSet.Add("5");
            someSet.SymmetricExceptWith(set);
            Assert.IsFalse(someSet.Contains("1"));
            Assert.IsFalse(someSet.Contains("2"));
            Assert.IsFalse(someSet.Contains("3"));
            Assert.IsFalse(someSet.Contains("4"));
            Assert.IsFalse(someSet.Contains("5"));
            Assert.AreEqual(0, someSet.Count);
        }
            public void SymmetricExceptWithTest()
            {
                var someSet = new GenericSet <int>();

                set.Add(1);
                set.Add(2);
                set.Add(0);
                set.Add(4);
                someSet.Add(5);
                someSet.Add(2);
                someSet.Add(0);
                someSet.Add(-1);
                someSet.Add(-4);
                someSet.SymmetricExceptWith(set);
                Assert.IsFalse(someSet.Contains(2));
                Assert.IsFalse(someSet.Contains(0));
                Assert.IsTrue(someSet.Contains(1));
                Assert.IsTrue(someSet.Contains(-1));
                Assert.IsTrue(someSet.Contains(4));
                Assert.IsTrue(someSet.Contains(-4));
                Assert.IsTrue(someSet.Contains(5));
                Assert.AreEqual(5, someSet.Count);
            }