Example #1
0
        public void AddArrayListByIndex_WhenInvalidValuePassed_ShouldReturnIndexOutOfRangeException_NegativeTests(
            ArrayList list, int index, int[] actualArray)
        {
            ArrayList actual = ArrayList.Create(actualArray);

            Assert.Throws <IndexOutOfRangeException>(() => actual.AddArrayListByIndex(list, index));
        }
Example #2
0
        public void Add_ArrayListByIndex(int index, int[] actualArray, int[] expectedArray)
        {
            ArrayList actual   = ArrayList.Create(actualArray);
            ArrayList expected = ArrayList.Create(expectedArray);
            ArrayList addList  = ArrayList.Create(new int[] { 77, 77, 77 });

            actual.AddArrayListByIndex(addList, index);
            Assert.AreEqual(expected, actual);
        }
Example #3
0
        public void AddArrayListByIndexTest(int index, int[] array, int[] insertArray, int[] expectedArray)
        {
            ArrayList actual   = new ArrayList(array);
            ArrayList expected = new ArrayList(expectedArray);
            ArrayList insert   = new ArrayList(insertArray);

            actual.AddArrayListByIndex(index, insert);

            Assert.AreEqual(expected, actual);
        }
Example #4
0
        public void AddArrayListByIndex_WhenValidValuePassed_ShouldAddArrayListByIndexToOtherList_Tests(
            int index, int[] actualArray, int[] expectedArray)
        {
            ArrayList actual    = ArrayList.Create(actualArray);
            ArrayList expected  = ArrayList.Create(expectedArray);
            ArrayList addedList = ArrayList.Create(new int[] { 0, 0, 0 });

            actual.AddArrayListByIndex(addedList, index);

            Assert.AreEqual(expected, actual);
        }
Example #5
0
 public void AddArrayListByIndexTest(int[] inputArray, int[] additionalArray, int index, int[] expectedArray)
 {
     SetUp(inputArray, expectedArray, additionalArray);
     actual.AddArrayListByIndex(additional, index);
     Assert.AreEqual(expected, actual);
 }