Example #1
0
        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); });
        }
Example #2
0
        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);
        }
Example #3
0
        public void AddListAtIndex_WhenNullPassed_ThrowArgumentNullException(IList array, int[] arrayList, int index)
        {
            ArrayList list = ArrayList.CreateArrayList(arrayList);

            Assert.Throws <ArgumentNullException>(() => list.AddListAtIndex(array, index));
        }