예제 #1
0
 public void SortInAscendingOrderBySumOfElements()
 {
     int[][] array = new int[3][] { new int[3] {
                                        1, 2, 3
                                    }, new int[3] {
                                        0, 1, -6
                                    }, new int[3] {
                                        10, 11, 12
                                    } };
     int[][] array1 = new int[3][] { array[1], array[0], array[2] };
     JaggedArraySort.DoSort(array, new ComparerBySumToUp());
     Assert.IsTrue(Equals(array, array1));
 }
예제 #2
0
 public void SortInDescendingOrderByAbsoluteMaxElements()
 {
     int[][] array = new int[3][] { new int[3] {
                                        1, 2, 3
                                    }, new int[3] {
                                        4, 5, -6
                                    }, new int[3] {
                                        0, 1, 2
                                    } };
     int[][] array1 = new int[3][] { array[1], array[0], array[2] };
     JaggedArraySort.DoSort(array, new ComparerByAbsoluteMaxToDown());
     Assert.IsTrue(Equals(array, array1));
 }