コード例 #1
0
        public void AddByIndex_WhenInputIsValid_ShouldAddItToCollection(
            int index, int valueToInsert, int[] inputArray, int[] expectedArray)
        {
            Create_Arrays(inputArray, expectedArray);

            actualList.AddByIndex(index, valueToInsert);

            Assert.AreEqual(expectedList, actualList);
        }
コード例 #2
0
        public void AddByIndex_WhenValidValuePassed_ShouldAddToListByIndex(int value, int index, int[] actualArray, int[] expectedArray)
        {
            CreateLists(actualArray, expectedArray, null);

            actual.AddByIndex(index, value);

            Assert.AreEqual(expected, actual);
        }
コード例 #3
0
        public void AddByIndexTests_WhenAddElementByIndexInList_ListWithNewElementInTheIndexPositionReturned(
            int[] input, int index, int value, int[] output)
        {
            Setup(inputArray: input, expectedArray: output);

            actual.AddByIndex(index, value);

            Assert.AreEqual(expected, actual);
        }
        public void AddByIndex_WhenInvalidPassed_ShouldReturnArgumentException(int index, string value, string[] actualArray)
        {
            CreateList(actualArray);

            Assert.Throws <ArgumentException>(() => actual.AddByIndex(index, value));
        }