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; } }
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); }
public void DeleteFromNegativeTest(int[] array, int idx) { DataStructure.ArrayList actual = new DataStructure.ArrayList(array); Assert.Throws <IndexOutOfRangeException>(() => actual.DeleteFrom(idx)); }