示例#1
0
        public void AddByIndexNegativTests(int[] array, int index, int value, int[] expArray)
        {
            DoubleLinkedList expected = new DoubleLinkedList(expArray);
            DoubleLinkedList actual   = new DoubleLinkedList(array);

            Assert.Throws <IndexOutOfRangeException>(() => actual.AddByIndex(index, value));
        }
示例#2
0
        public void AddByIndexTest(int[] array, int index, int value, int[] expected)
        {
            DoubleLinkedList Expect = new DoubleLinkedList(expected);
            DoubleLinkedList actual = new DoubleLinkedList(array);

            actual.AddByIndex(index, value);
            Assert.AreEqual(Expect, actual);
        }
        public void AddByIndexTest(int[] actualArray, int index, int[] array, int[] exp)
        {
            DoubleLinkedList expected = new DoubleLinkedList(exp);
            DoubleLinkedList actual   = new DoubleLinkedList(actualArray);

            actual.AddByIndex(index, array);
            Assert.AreEqual(expected, actual);
        }
示例#4
0
        public void AddByIndex_IndexExistsInTheList_ShouldAddValueByIndex(int index, int value, int[] actualArray, int[] expectedArray)
        {
            DoubleLinkedList expected = new DoubleLinkedList(expectedArray);
            DoubleLinkedList actual   = new DoubleLinkedList(actualArray);

            actual.AddByIndex(index, value);
            Assert.AreEqual(expected, actual);
        }
        public void AddByIndexMassiveTest(int index, int[] values, int[] array, int[] expectedArray)
        {
            DoubleLinkedList actual   = new DoubleLinkedList(array);
            DoubleLinkedList expected = new DoubleLinkedList(expectedArray);

            actual.AddByIndex(index, values);
            Assert.AreEqual(expected, actual);
        }
示例#6
0
        public void AddByIndex_WhenValidValuePassed_ShouldAddValueOnPositionByIndexInTheList_Tests(
            int value, int index, int[] actualArray, int[] expectedArray)
        {
            DoubleLinkedList actual   = DoubleLinkedList.Create(actualArray);
            DoubleLinkedList expected = DoubleLinkedList.Create(expectedArray);

            actual.AddByIndex(value, index);

            Assert.AreEqual(expected, actual);
        }
        public void AddByIndexFewElementsTest(int value, int quantity, int index, int[] array, int[] expectedArray)
        {
            DoubleLinkedList actual   = new DoubleLinkedList(array);
            DoubleLinkedList expected = new DoubleLinkedList(expectedArray);

            for (int i = 0; i < quantity; i++)
            {
                actual.AddByIndex(index, value);
            }

            Assert.AreEqual(expected, actual);
        }
示例#8
0
        public void NegativeAddByIndexTest(int[] array, int index, int value)
        {
            DoubleLinkedList actual = new DoubleLinkedList(array);

            try
            {
                actual.AddByIndex(index, value);
            }
            catch
            {
                Assert.Pass();
            }
            Assert.Fail();
        }
        public void AddByIndexTestNegative(int[] array, int value, int index)
        {
            DoubleLinkedList doubleLinkedList = new DoubleLinkedList(array);

            try
            {
                doubleLinkedList.AddByIndex(value, index);
            }
            catch
            {
                Assert.Pass();
            }
            Assert.Fail();
        }
示例#10
0
        public void AddByIndex_WhenInvalidValuePaseed_ShouldReturnIndexOutOfRangeException_NegativeTests(int value, int index, int[] actualArray)
        {
            DoubleLinkedList actual = DoubleLinkedList.Create(actualArray);

            Assert.Throws <IndexOutOfRangeException>(() => actual.AddByIndex(value, index));
        }
示例#11
0
        public void AddByIndexTestNegative(int[] array, int index, int value)
        {
            DoubleLinkedList a = new DoubleLinkedList(array);

            Assert.Throws <IndexOutOfRangeException>(() => a.AddByIndex(index, value));
        }
示例#12
0
        public void AddByIndex_WhenIndexNotExist_ShouldIndexOutOfRangeException(int value, int index, int[] actualArray)
        {
            DoubleLinkedList actual = new DoubleLinkedList(actualArray);

            Assert.Throws <IndexOutOfRangeException>(() => actual.AddByIndex(index, value));
        }
        public void AddByIndexMassiveNegativeTest(int index, int[] array)
        {
            DoubleLinkedList actual = new DoubleLinkedList(array);

            Assert.Throws <IndexOutOfRangeException>(() => actual.AddByIndex(index, new int[] { 1, 2, 3 }));
        }