public void Sort_ByMaxAscending() { int[][] testArray = { null, null, new[] { 4, 1, 5 }, new[] { 7,2 }, new[] { 3, 1,6, 2 } }; var jaggedArrayByMaxAsc = new JaggedArrayByMaxAscendingSorter(); int[][] expectedArray = { new[] { 4, 1, 5 }, new[] { 3, 1,6, 2 }, new[] { 7,2 }, null, null }; Sort(testArray, jaggedArrayByMaxAsc); CollectionAssert.AreEqual(testArray, expectedArray); }
public void Sort_ByMaxAscending() { int[][] testArray = { null, null, new[] { 4, 1, 5 }, new[] { 7,2 }, new[] { 3, 1,6, 2 } }; var jaggedArrayByMaxAsc = new JaggedArrayByMaxAscendingSorter(); Func <int[], int[], int> comparisonFunc = jaggedArrayByMaxAsc.Compare; int[][] expectedArray = { new[] { 4, 1, 5 }, new[] { 3, 1,6, 2 }, new[] { 7,2 }, null, null }; Sort(testArray, comparisonFunc); CollectionAssert.AreEqual(testArray, expectedArray); }