public void MaxAbsElementsDecreasingBothArraysAbsEqualTest() { int[] arr1 = new int[] { -1, 2, 3, 4, 8, -9, 18 }; int[] arr2 = new int[] { 1, 2, 3, -9, -18 }; MaxAbsElementsDecreasing st = new MaxAbsElementsDecreasing(); int expected = ((IComparer)st).Compare(arr1, arr2); Assert.AreEqual(expected, 0); }
public void MaxAbsElementsDecreasingFirstArrayAbsLowerTest() { int[] arr1 = new int[] { 1, 2, 3, -4 , -48 }; int[] arr2 = new int[] { 4, 5, 6, -20, 49, -30 }; MaxAbsElementsDecreasing st = new MaxAbsElementsDecreasing(); int expected = ((IComparer)st).Compare(arr1, arr2); Assert.AreEqual(expected, 1); }
public void MaxAbsElementsDecreasingSecondArrayAbsLowerTest() { int[] arr1 = new int[] { 4, 5, 6 , 10, 20}; int[] arr2 = new int[] { 1, 2, 3, -19 }; MaxAbsElementsDecreasing st = new MaxAbsElementsDecreasing(); int expected = ((IComparer)st).Compare(arr1, arr2); Assert.AreEqual(expected, -1); }
public void QuickSortMaxAbsDecreasingInterfaceTest() { int[][] expected = new int[][] { array[8], array[0], array[1], array[4], array[5], array[6], array[2], null, null, null, null }; QuickSorter qs = new QuickSorter(); MaxAbsElementsDecreasing st = new MaxAbsElementsDecreasing(); array.Sort(qs, st); int[][] actual = array; CollectionAssert.AreEqual(expected, actual); }