Example #1
0
        public void UnionWithTest()
        {
            var someSet = new GenericSet <string>();

            set.Add("One");
            set.Add("Two");
            set.Add("Three");
            someSet.Add("Five");
            someSet.Add("Six");
            someSet.UnionWith(set);
            Assert.IsTrue(someSet.Contains("Three"));
            Assert.IsTrue(someSet.Contains("One"));
            Assert.IsTrue(someSet.Contains("Six"));
            Assert.IsTrue(someSet.Contains("Five"));
            Assert.IsTrue(someSet.Contains("Two"));
            Assert.AreEqual(5, someSet.Count);
        }
            public void UnionWithTest()
            {
                var someSet = new GenericSet <int>();

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