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

            Assert.Throws <IndexOutOfRangeException>(() => actual.AddByIndex(index, value));
        }
Example #2
0
        public void GetByIndexTest(int[] array, int index, int expected)
        {
            DoubleLList DlinkedList = new DoubleLList(array);

            int actual = DlinkedList[index];

            Assert.AreEqual(expected, actual);
        }
Example #3
0
        public void DeleteByIndexTest(int[] array, int index, int[] expected)
        {
            DoubleLList Expect = new DoubleLList(expected);
            DoubleLList actual = new DoubleLList(array);

            actual.DeleteByIndex(index);
            Assert.AreEqual(Expect, actual);
        }
Example #4
0
        public void AddTest(int[] array, int value, int[] expected)
        {
            DoubleLList Expect = new DoubleLList(expected);
            DoubleLList actual = new DoubleLList(array);

            actual.Add(value);
            Assert.AreEqual(Expect, actual);
        }
Example #5
0
        public void DeleteAllByValueTest(int[] array, int value, int[] expArray)
        {
            DoubleLList expected = new DoubleLList(expArray);
            DoubleLList actual   = new DoubleLList(array);

            actual.DeleteAllByValue(value);
            Assert.AreEqual(expected, actual);
        }
Example #6
0
        public void DeleteByFirstTest(int[] array, int[] expArray)
        {
            DoubleLList expected = new DoubleLList(expArray);
            DoubleLList actual   = new DoubleLList(array);

            actual.DeleteByFirst();
            Assert.AreEqual(expected, actual);
        }
Example #7
0
        public void ReverseTest(int[] array, int[] expArray)
        {
            DoubleLList expected = new DoubleLList(expArray);
            DoubleLList actual   = new DoubleLList(array);

            actual.Reverse();
            Assert.AreEqual(expected, actual);
        }
Example #8
0
        public void DeleteByIndexNElementTest(int[] array, int index, int size, int[] expArray)
        {
            DoubleLList expected = new DoubleLList(expArray);
            DoubleLList actual   = new DoubleLList(array);

            actual.DeleteByIndexNElement(index, size);

            Assert.AreEqual(expected, actual);
        }
Example #9
0
        public void AddByIndexArrayTest(int[] array, int index, int[] value, int[] expArray)
        {
            DoubleLList expected = new DoubleLList(expArray);
            DoubleLList actual   = new DoubleLList(array);

            actual.AddByIndexArray(index, value);

            Assert.AreEqual(expected, actual);
        }
Example #10
0
        public void SetByIndexTest(int[] array, int index, int value, int[] expArray)
        {
            DoubleLList expected = new DoubleLList(expArray);
            DoubleLList actual   = new DoubleLList(array);

            actual[index] = value;

            Assert.AreEqual(expected, actual);
        }
Example #11
0
        public void GetIndexMinTest(int[] array, int expected)
        {
            DoubleLList actual = new DoubleLList(array);

            Assert.AreEqual(expected, actual.GetIndexMin());
        }
Example #12
0
        public void IndexByValueIndexTest(int[] array, int value, int expected)
        {
            DoubleLList actual = new DoubleLList(array);

            Assert.AreEqual(expected, actual.IndexByValue(value));
        }
Example #13
0
        public void GetMaxValueTest(int[] array, int expected)
        {
            DoubleLList actual = new DoubleLList(array);

            Assert.AreEqual(expected, actual.GetMaxValue());
        }