public void DeleteNElementsFromNegativTest(int[] array, int idx, int number, string excepyion) { DLinkedList actual = new DLinkedList(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) { DLinkedList actual = new DLinkedList(array); DLinkedList expected = new DLinkedList(expectedArray); actual.DeleteFrom(idx); Assert.AreEqual(expected, actual); }
public void DeleteFromNegativeTest(int[] array, int idx) { DLinkedList actual = new DLinkedList(array); Assert.Throws <IndexOutOfRangeException>(() => actual.DeleteFrom(idx)); }