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)); }
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)); }
public void FindIndexTests(int[] array, int expected, int number) { ArrayMyList List = new ArrayMyList(array); int actual = List.FindIndex(number); Assert.AreEqual(expected, actual); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
public void ReverseTests(int[] array, int[] expArray) { ArrayMyList expected = new ArrayMyList(expArray); ArrayMyList actual = new ArrayMyList(array); actual.Reverse(); Assert.AreEqual(expected, actual); }
public void DeleteByFirstTests(int[] array, int[] expArray) { ArrayMyList expected = new ArrayMyList(expArray); ArrayMyList actual = new ArrayMyList(array); actual.DeleteByFirst(); Assert.AreEqual(expected, actual); }
public void ArraySortTests(int[] array, int[] expArray) { ArrayMyList expected = new ArrayMyList(expArray); ArrayMyList actual = new ArrayMyList(array); actual.ArraySort(); Assert.AreEqual(expected, actual); }
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); }
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(); }
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(); }
public void FindMaxTests(int[] array, int expected) { ArrayMyList actual = new ArrayMyList(array); Assert.AreEqual(expected, actual.FindMax()); }
public void FindMaxIndexNegativTests(int[] array, int expected) { ArrayMyList actual = new ArrayMyList(array); Assert.Throws <Exception>(() => actual.FindMaxIndex()); }