public void AddListAtIndex_WhenIndexIsLessThanZeroOrBiggerThanArrayLength_ThrowIndexOutOfRangeException(int[] arrayListToAdd, int index, int[] arrayList) { ArrayList list = ArrayList.CreateArrayList(arrayList); ArrayList listToAdd = ArrayList.CreateArrayList(arrayListToAdd); Assert.Throws <IndexOutOfRangeException>(() => { list.AddListAtIndex(listToAdd, index); }); }
public void AddListAtIndex_WhenArrayListAndIndexPassed_AddPassedArrayListToArrayListOnTheGivenIndex(int[] listToAdd, int index, int[] actualArray, int[] expectedArray) { ArrayList actual = ArrayList.CreateArrayList(actualArray); ArrayList expected = ArrayList.CreateArrayList(expectedArray); ArrayList list = ArrayList.CreateArrayList(listToAdd); actual.AddListAtIndex(list, index); Assert.AreEqual(expected, actual); }
public void AddListAtIndex_WhenNullPassed_ThrowArgumentNullException(IList array, int[] arrayList, int index) { ArrayList list = ArrayList.CreateArrayList(arrayList); Assert.Throws <ArgumentNullException>(() => list.AddListAtIndex(array, index)); }