public void TestInvalidCopyTo2() { PascalSet set = new PascalSet(10, new int[] { 1, 2, 5, 6 }); int[] array = new int[4]; set.CopyTo(array, 1); }
public void ExceptionInvalid2() { var pascalSet = new PascalSet(10, new[] { 1, 2, 5, 6 }); var array = new int[4]; pascalSet.CopyTo(array, 1); }
public void ExceptionInvalid2() { var pascalSet = new PascalSet(10, new[] { 1, 2, 5, 6 }); var array = new int[4]; Assert.Throws <ArgumentException>(() => pascalSet.CopyTo(array, 1)); }
public void TestCopyTo() { PascalSet set = new PascalSet(10, new int[] { 1, 2, 5, 6 }); int[] array = new int[4]; set.CopyTo(array, 0); List <int> l = new List <int>(array); Assert.AreEqual(l.Contains(1), true); Assert.AreEqual(l.Contains(2), true); Assert.AreEqual(l.Contains(5), true); Assert.AreEqual(l.Contains(6), true); }
public void Simple() { var pascalSet = new PascalSet(10, new[] { 1, 2, 5, 6 }); var array = new int[4]; pascalSet.CopyTo(array, 0); var list = new List<int>(array); Assert.IsTrue(list.Contains(1)); Assert.IsTrue(list.Contains(2)); Assert.IsTrue(list.Contains(5)); Assert.IsTrue(list.Contains(6)); }
public void Simple() { var pascalSet = new PascalSet(10, new[] { 1, 2, 5, 6 }); var array = new int[4]; pascalSet.CopyTo(array, 0); var list = new List <int>(array); Assert.IsTrue(list.Contains(1)); Assert.IsTrue(list.Contains(2)); Assert.IsTrue(list.Contains(5)); Assert.IsTrue(list.Contains(6)); }
public void CopyToExample() { // Create a sample PascalSet instance var pascalSet = new PascalSet(100); // Set a couple of values in the PascalSet for (var i = 0; i < 100; i += 10) { pascalSet.Add(i); } // Create an array to store the items in var values = new int[10]; // Copy the items in the set to the array, at index 0 pascalSet.CopyTo(values, 0); }
public void ExcepionNullArray() { var pascalSet = new PascalSet(20); Assert.Throws <ArgumentNullException>(() => pascalSet.CopyTo(null, 0)); }
public void ExcepionNullArray() { var pascalSet = new PascalSet(20); pascalSet.CopyTo(null, 0); }
public void TestNullCopyTo() { PascalSet set = new PascalSet(20); set.CopyTo(null, 0); }