public void SumArraySort_PositiveNumbers() { int[] first = new[] { 1, 2, 3, 10, 5 }; //21 int[] second = new[] { 5, 4, 13, 2, 1 }; //25 int[] third = new[] { 1, 12, 3, 4 }; // 20 int[][] array = new[] { first, second, third }; SumArraySort comparer = new SumArraySort(); Sorter.Sort(array, comparer); int[][] result = new[] { second, first, third }; Assert.IsTrue(CompareArrays(result, array)); }
public void SumArraySort_MixedNumbers() { int[] first = new[] { -1, 2, 3, -10, 5 }; //-1 int[] second = new[] { -5, 4, 13, 2, -1 }; //13 int[] third = new[] { -1, 12, 3, -4 }; //10 int[][] array = new[] { first, second, third }; SumArraySort comparer = new SumArraySort(); Sorter.Sort(array, comparer); int[][] result = new[] { second, third, first }; Assert.IsTrue(CompareArrays(result, array)); }
public void SumArraySort_NegativeNumbers() { int[] first = new[] { -1, -2, -3, -10, -5 }; //-21 int[] second = new[] { -5, -4, -13, -2, -1 }; //-25 int[] third = new[] { -1, -12, -3, -4 }; //-20 int[][] array = new[] { first, second, third }; SumArraySort comparer = new SumArraySort(); Sorter.Sort(array, comparer); int[][] result = new[] { third, first, second }; Assert.IsTrue(CompareArrays(result, array)); }