Example #1
0
        public void TestInvalidProperSubsetOf()
        {
            PascalSet s1 = new PascalSet(0, 50, new int[] { 15, 20, 30 });
            PascalSet s2 = new PascalSet(10, 60, new int[] { 15, 20, 60 });

            s1.IsProperSubsetOf(s2);
        }
Example #2
0
        public void Simple()
        {
            var s1 = new PascalSet(0, 50, new[] { 15, 20, 30, 40, 34 });
            var s2 = new PascalSet(0, 50, new[] { 15, 20, 30 });
            var s3 = new PascalSet(0, 50, new[] { 15, 20, 30, 40, 34 });

            Assert.IsFalse(s1.IsProperSubsetOf(s2));
            Assert.IsTrue(s2.IsProperSubsetOf(s1));
            Assert.IsFalse(s3.IsProperSubsetOf(s1));
            Assert.IsFalse(s1.IsProperSubsetOf(s3));

            Assert.IsFalse(s1 < s2);
            Assert.IsTrue(s2 < s1);
            Assert.IsFalse(s3 < s1);
            Assert.IsFalse(s1 < s3);
        }
Example #3
0
        public void ExceptionInvalidProperSubsetOf()
        {
            var s1 = new PascalSet(0, 50, new[] { 15, 20, 30 });
            var s2 = new PascalSet(10, 60, new[] { 15, 20, 60 });

            Assert.Throws <ArgumentException>(() => s1.IsProperSubsetOf(s2));
        }
Example #4
0
        public void TestIsProperSubsetOf()
        {
            PascalSet s1 = new PascalSet(0, 50, new int[] { 15, 20, 30, 40, 34 });
            PascalSet s2 = new PascalSet(0, 50, new int[] { 15, 20, 30 });
            PascalSet s3 = new PascalSet(0, 50, new int[] { 15, 20, 30, 40, 34 });

            Assert.AreEqual(s1.IsProperSubsetOf(s2), false);
            Assert.AreEqual(s2.IsProperSubsetOf(s1), true);
            Assert.AreEqual(s3.IsProperSubsetOf(s1), false);
            Assert.AreEqual(s1.IsProperSubsetOf(s3), false);

            Assert.AreEqual(s1 < s2, false);
            Assert.AreEqual(s2 < s1, true);
            Assert.AreEqual(s3 < s1, false);
            Assert.AreEqual(s1 < s3, false);
        }
Example #5
0
        public void ExceptionInvalidProperSubsetOf()
        {
            var s1 = new PascalSet(0, 50, new[] { 15, 20, 30 });
            var s2 = new PascalSet(10, 60, new[] { 15, 20, 60 });

            s1.IsProperSubsetOf(s2);
        }
Example #6
0
        public void IsProperSubsetOfExample()
        {
            // Create 3 pascal sets with various items
            var pascalSet1 = new PascalSet(0, 50, new[] { 15, 20, 30, 40, 34 });
            var pascalSet2 = new PascalSet(0, 50, new[] { 15, 20, 30 });
            var pascalSet3 = new PascalSet(0, 50, new[] { 15, 20, 30, 40, 34 });

            // s1 is not a proper subset of s2
            Assert.IsFalse(pascalSet1.IsProperSubsetOf(pascalSet2));

            // s2 is a proper subset of s1
            Assert.IsTrue(pascalSet2.IsProperSubsetOf(pascalSet1));

            // s3 is not a proper subset of s1
            Assert.IsFalse(pascalSet3.IsProperSubsetOf(pascalSet1));

            // s1 is a proper subset of s3
            Assert.IsFalse(pascalSet1.IsProperSubsetOf(pascalSet3));
        }
Example #7
0
        public void ExceptionNullSet()
        {
            var pascalSet = new PascalSet(500);

            Assert.Throws <ArgumentNullException>(() => pascalSet.IsProperSubsetOf(null));
        }
Example #8
0
        public void TestNullIsProperSubsetOf()
        {
            PascalSet set = new PascalSet(20);

            set.IsProperSubsetOf(null);
        }
Example #9
0
        public void ExceptionNullSet()
        {
            var pascalSet = new PascalSet(500);

            pascalSet.IsProperSubsetOf(null);
        }