public void AddToTest(int[] array, int idx, int value, int[] expectedArray) { DLinkedList actual = new DLinkedList(array); DLinkedList expected = new DLinkedList(expectedArray); actual.AddTo(idx, value); Assert.AreEqual(expected, actual); }
public void AddToNegativeTest(int[] array, int idx, int value) { DLinkedList actual = new DLinkedList(array); Assert.Throws <IndexOutOfRangeException>(() => actual.AddTo(idx, value)); }