public void Test1()
        {
            IndexedSet <int>  set1 = new IndexedSet <int>();
            IEnumerable <int> set2 = new List <int>();

            Assert.True(set1.IsSupersetOf(set2));
        }
        public void Test3()
        {
            IndexedSet <int>  set1 = new IndexedSet <int>();
            IEnumerable <int> set2 = new List <int>()
            {
                0, 0
            };

            Assert.False(set1.IsSupersetOf(set2));
        }
        public void Test10()
        {
            IndexedSet <int> set1 = new IndexedSet <int>()
            {
                1, 2, 3, 4
            };
            IEnumerable <int> set2 = null;

            Assert.Throws <ArgumentNullException>(() => set1.IsSupersetOf(set2));
        }
        public void Test7()
        {
            IndexedSet <int> set1 = new IndexedSet <int>()
            {
                1, 2, 3, 4
            };
            IEnumerable <int> set2 = new List <int>()
            {
                1, 1, 1, 2, 2, 3, 3, 3, -1
            };

            Assert.False(set1.IsSupersetOf(set2));
        }
        public void Test6()
        {
            IndexedSet <int> set1 = new IndexedSet <int>()
            {
                1, 2, 3, 4, 5
            };
            IEnumerable <int> set2 = new List <int>()
            {
                1, 1, 1, 2, 2, 3, 3, 3
            };

            Assert.True(set1.IsSupersetOf(set2));
        }
Esempio n. 6
0
        public void IsSupersetOfTest()
        {
            var firstSet  = new IndexedSet <string>();
            var secondSet = new IndexedSet <string>();

            Assert.True(firstSet.IsSupersetOf(secondSet));
            Assert.True(secondSet.IsSupersetOf(firstSet));

            firstSet.Add("A");

            Assert.True(firstSet.IsSupersetOf(secondSet));
            Assert.False(secondSet.IsSupersetOf(firstSet));

            secondSet.Add("A");

            Assert.True(firstSet.IsSupersetOf(secondSet));
            Assert.True(secondSet.IsSupersetOf(firstSet));

            firstSet.Add("B");

            Assert.True(firstSet.IsSupersetOf(secondSet));
            Assert.False(secondSet.IsSupersetOf(firstSet));
        }