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); }
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); }
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)); }
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); }
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); }
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)); }
public void ExceptionNullSet() { var pascalSet = new PascalSet(500); Assert.Throws <ArgumentNullException>(() => pascalSet.IsProperSubsetOf(null)); }
public void TestNullIsProperSubsetOf() { PascalSet set = new PascalSet(20); set.IsProperSubsetOf(null); }
public void ExceptionNullSet() { var pascalSet = new PascalSet(500); pascalSet.IsProperSubsetOf(null); }