Example #1
0
        public void Insert_ItemInsertionAtBeginningDoesNotChangeSequenceOfArray()
        {
            NewList <int> list = new NewList <int> {
                1, 2, 3
            };
            NewList <int> secondList = new NewList <int> {
                5, 1, 2, 3
            };

            list.Insert(1, 5);
            Assert.Equal(secondList, list);
        }
Example #2
0
        public void Insert_ItemInsertionAtTheEndDoesNotChangesSequenceOfArray()
        {
            NewList <int> list = new NewList <int> {
                1, 2, 3
            };
            NewList <int> secondList = new NewList <int> {
                1, 2, 3, 4
            };

            list.Insert(4, 4);
            Assert.Equal(secondList, list);
        }
Example #3
0
        public void Insert_ItemInsertionInTheMiddleDoesNotChangeSequenceOfArray()
        {
            NewList <int> list = new NewList <int> {
                10, 20, 40
            };
            NewList <int> secondList = new NewList <int> {
                10, 50, 20, 40
            };

            list.Insert(2, 50);
            Assert.Equal(secondList, list);
        }
Example #4
0
 public void Insert(int index, TNew item)
 {
     NewList.Insert(index, item);
     OriginalList.Insert(index, item.OriginalDictionary);
 }