Ejemplo n.º 1
0
        public void DeleteNElementsFromNegativTest(int[] array, int idx, int number, string excepyion)
        {
            DataStructure.ArrayList actual = new DataStructure.ArrayList(array);
            switch (excepyion)
            {
            case "Index":
                Assert.Throws <IndexOutOfRangeException>(() => actual.DeleteFrom(idx, number));
                break;

            case "Argument":
                Assert.Throws <ArgumentOutOfRangeException>(() => actual.DeleteFrom(idx, number));
                break;
            }
        }
Ejemplo n.º 2
0
 public void DeleteFromTest(int[] array, int idx, int[] expectedArray)
 {
     DataStructure.ArrayList actual = new DataStructure.ArrayList(array);
     actual.DeleteFrom(idx);
     DataStructure.ArrayList expected = new DataStructure.ArrayList(expectedArray);
     Assert.AreEqual(expected, actual);
 }
Ejemplo n.º 3
0
 public void DeleteFromNegativeTest(int[] array, int idx)
 {
     DataStructure.ArrayList actual = new DataStructure.ArrayList(array);
     Assert.Throws <IndexOutOfRangeException>(() => actual.DeleteFrom(idx));
 }