public void AddExample() { // Create a sample PascalSet instance var pascalSet = new PascalSet(100) { 10, 57 }; // There will be two items in the set Assert.AreEqual(2, pascalSet.Count); // And the set will contain the 10th and 57th item Assert.IsTrue(pascalSet.Contains(10)); Assert.IsTrue(pascalSet.Contains(57)); }
public void ContainsExample() { // Create a sample PascalSet instance var pascalSet = new PascalSet(100); // Add the 10th item to the set pascalSet.Add(10); // Add the 57th item to the set pascalSet.Add(57); // There will be two items in the set Assert.AreEqual(pascalSet.Count, 2); // And the set will contain the 10th and 57th item Assert.IsTrue(pascalSet.Contains(10)); Assert.IsTrue(pascalSet.Contains(57)); // But not the item 84 Assert.IsFalse(pascalSet.Contains(84)); }
public void Simple() { var pascalSet = new PascalSet(0, 50, new[] { 20, 30, 40 }); Assert.IsTrue(pascalSet.Contains(20)); Assert.IsTrue(pascalSet.Contains(30)); Assert.IsTrue(pascalSet.Contains(40)); Assert.IsFalse(pascalSet.Contains(25)); Assert.IsFalse(pascalSet.Contains(35)); Assert.IsFalse(pascalSet.Contains(45)); }
public void TestContains() { PascalSet s1 = new PascalSet(0, 50, new int[] { 20, 30, 40 }); Assert.AreEqual(s1.Contains(20), true); Assert.AreEqual(s1.Contains(30), true); Assert.AreEqual(s1.Contains(40), true); Assert.AreEqual(s1.Contains(25), false); Assert.AreEqual(s1.Contains(35), false); Assert.AreEqual(s1.Contains(45), false); }