Example #1
0
        public void PopFrontNegativTests(int[] array, int[] expArray, int size = 1)
        {
            ArrayMyList expected = new ArrayMyList(expArray);
            ArrayMyList actual   = new ArrayMyList(array);

            Assert.Throws <IndexOutOfRangeException>(() => actual.PopFront(size));
        }
Example #2
0
        public void DeleteElemNegativTests(int[] array, int[] expArray, int index, int size = 1)
        {
            ArrayMyList expected = new ArrayMyList(expArray);
            ArrayMyList actual   = new ArrayMyList(array);

            Assert.Throws <IndexOutOfRangeException>(() => actual.DeleteElem(index, size));
        }
Example #3
0
        public void FindIndexTests(int[] array, int expected, int number)
        {
            ArrayMyList List   = new ArrayMyList(array);
            int         actual = List.FindIndex(number);

            Assert.AreEqual(expected, actual);
        }
Example #4
0
        public void DeleteElemTests(int[] array, int[] expArray, int index, int number = 1)
        {
            ArrayMyList expected = new ArrayMyList(expArray);
            ArrayMyList actual   = new ArrayMyList(array);

            actual.DeleteElem(index, number);
            Assert.AreEqual(expected, actual);
        }
Example #5
0
        public void Push_BackTests(int[] array, int[] expArray, int value)
        {
            ArrayMyList expected = new ArrayMyList(expArray);
            ArrayMyList actual   = new ArrayMyList(array);

            actual.Push_Back(value);
            Assert.AreEqual(expected, actual);
        }
Example #6
0
        public void Pop_FrontTests(int[] array, int[] expArray, int number = 1)
        {
            ArrayMyList expected = new ArrayMyList(expArray);
            ArrayMyList actual   = new ArrayMyList(array);

            actual.PopFront(number);
            Assert.AreEqual(expected, actual);
        }
Example #7
0
        public void AddArrTests(int[] array, int[] expArray, int index, int[] arr)
        {
            ArrayMyList expected = new ArrayMyList(expArray);
            ArrayMyList actual   = new ArrayMyList(array);

            actual.AddArr(index, arr);
            Assert.AreEqual(expected, actual);
        }
Example #8
0
        public void AddElemTests(int[] array, int[] expArray, int index, int value)
        {
            ArrayMyList expected = new ArrayMyList(expArray);
            ArrayMyList actual   = new ArrayMyList(array);

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

            actual.DeleteEqualValue(value);
            Assert.AreEqual(expected, actual);
        }
Example #10
0
        public void Push_FrontArrayTests(int[] array, int[] expArray, int[] arr)
        {
            ArrayMyList expected = new ArrayMyList(expArray);
            ArrayMyList actual   = new ArrayMyList(array);

            actual.Push_FrontArray(arr);
            Assert.AreEqual(expected, actual);
        }
Example #11
0
        public void ReverseTests(int[] array, int[] expArray)
        {
            ArrayMyList expected = new ArrayMyList(expArray);
            ArrayMyList actual   = new ArrayMyList(array);

            actual.Reverse();
            Assert.AreEqual(expected, actual);
        }
Example #12
0
        public void DeleteByFirstTests(int[] array, int[] expArray)
        {
            ArrayMyList expected = new ArrayMyList(expArray);
            ArrayMyList actual   = new ArrayMyList(array);

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

            actual.ArraySort();
            Assert.AreEqual(expected, actual);
        }
Example #14
0
        public void Pop_BackTests(int[] array, int[] expArray, int size = 1)
        {
            ArrayMyList expected = new ArrayMyList(expArray);
            ArrayMyList actual   = new ArrayMyList(array);

            actual.PopBack(size);
            Assert.AreEqual(expected, actual);
        }
Example #15
0
        static void Main(string[] args)
        {
            ArrayMyList A = new ArrayMyList();

            A.Push_Back(2);
            A.Push_Back(2);
            A.Push_Back(2);
            A.Push_Back(3);
            Console.WriteLine();
            A.ConsoleArr();
            A.DeleteElem(1);
            A.DeletePerv();
            Console.WriteLine();
            A.ConsoleArr();
        }
Example #16
0
        public void SetByIndexNegativeTest(int[] array, int index)
        {
            ArrayMyList actual = new ArrayMyList(array);

            //Assert.Throws<IndexOutOfRangeException>(() => actual[index] = 0);

            try
            {
                actual[index] = 0;
            }
            catch (IndexOutOfRangeException)
            {
                Assert.Pass();
            }
            Assert.Fail();
        }
Example #17
0
        public void FindMaxTests(int[] array, int expected)
        {
            ArrayMyList actual = new ArrayMyList(array);

            Assert.AreEqual(expected, actual.FindMax());
        }
Example #18
0
        public void FindMaxIndexNegativTests(int[] array, int expected)
        {
            ArrayMyList actual = new ArrayMyList(array);

            Assert.Throws <Exception>(() => actual.FindMaxIndex());
        }