public void SortingBySumOfElementsTest_WithSameRow() { int[][] source = new int[][] { new int[] { 1, 1, 1 }, new int[] { 1, 1, 1 }, new int[] { 1, 1, 1 }, }; int[][] expected = new int[][] { new int[] { 1, 1, 1 }, new int[] { 1, 1, 1 }, new int[] { 1, 1, 1 }, }; SortingJaggedArray.SortingBySumOfElements(source); Assert.AreEqual(source, expected); }
public void SortingBySumOfElementsTest_WithNormalArray() { int[][] source = new int[][] { new int[] { 1, -1, 1, -1 }, new int[] { 2, 4, 5 }, new int[] { 2 }, }; int[][] expected = new int[][] { new int[] { 1, -1, 1, -1 }, new int[] { 2 }, new int[] { 2, 4, 5 }, }; SortingJaggedArray.SortingBySumOfElements(source); Assert.AreEqual(source, expected); }
public void SortingByMinElementsTest_WithNormalArray() { int[][] source = new int[][] { new int[] { 4, 5, 6, 7, 8 }, new int[] { 1, 2, 3 }, new int[] { 12, 13 }, new int[] { 9, 10, 11 }, }; int[][] expected = new int[][] { new int[] { 1, 2, 3 }, new int[] { 4, 5, 6, 7, 8 }, new int[] { 9, 10, 11 }, new int[] { 12, 13 }, }; SortingJaggedArray.SortingByMinElements(source); Assert.AreEqual(source, expected); }
public void SortingByMaxElementsTest_WithNormalArray() { int[][] source = new int[][] { new int[] { 1, 2, 3, 4, 5 }, new int[] { -1, -2, -3, -4 }, new int[] { 6, 7 }, new int[] { -10, -20 } }; int[][] expected = new int[][] { new int[] { -10, -20 }, new int[] { -1, -2, -3, -4 }, new int[] { 1, 2, 3, 4, 5 }, new int[] { 6, 7 } }; SortingJaggedArray.SortingByMaxElements(source); Assert.AreEqual(source, expected); }
public void SortingByMinElementsTest_WithMaxValueAndMinValue() { int[][] source = new int[][] { new int[] { -10, 10, int.MinValue, int.MaxValue, 1 }, new int[] { -123456, 10, 111, 5632, 1, -11111 }, new int[] { int.MaxValue, 1345 }, new int[] { -100000000, 123456, 1 }, new int[] { 1 }, }; int[][] expected = new int[][] { new int[] { -10, 10, int.MinValue, int.MaxValue, 1 }, new int[] { -100000000, 123456, 1 }, new int[] { -123456, 10, 111, 5632, 1, -11111 }, new int[] { 1 }, new int[] { int.MaxValue, 1345 }, }; SortingJaggedArray.SortingByMinElements(source); Assert.AreEqual(source, expected); }
public void SortingByMaxElementsTest_WithOneElementInRow() { int[][] source = new int[][] { new int[] { 10 }, new int[] { -100 }, new int[] { 1000 }, new int[] { -1000 }, new int[] { 200 }, }; int[][] expected = new int[][] { new int[] { -1000 }, new int[] { -100 }, new int[] { 10 }, new int[] { 200 }, new int[] { 1000 } }; SortingJaggedArray.SortingByMaxElements(source); Assert.AreEqual(source, expected); }
public void TestNullExeptionMSumValueInLinesInJaggedArray() { Assert.Throws <NullReferenceException>(() => SortingJaggedArray.SortBySumValueInLines(testExp2, true)); }
public void SortingBySumValueInLinesInJaggedArrayDescendingWay() { Assert.IsTrue(EquilityArray(SortingJaggedArray.SortBySumValueInLines(common, false), sumSortDescending)); }
public void SortingByMinValueInLinesInJaggedArrayAscendingWay() { Assert.IsTrue(EquilityArray(SortingJaggedArray.SortByMinValueInLines(common, true), minSortAscending)); }
public void SortingByMinElementsTests_WithEmptyRow_ThrowArgumentException() => Assert.Throws <ArgumentException>(() => SortingJaggedArray.SortingByMinElements(new int[][] { new int[] { 1, 2 }, new int[] { } }));
public void SortingByMaxElementsTests_WithNullRow_ThrowArgumentNullException() => Assert.Throws <ArgumentNullException>(() => SortingJaggedArray.SortingByMaxElements(new int[][] { new int[] { 1, 2 }, null }));
public void SortingByMinElementsTests_WithEmptyArray_ThrowArgumentException() => Assert.Throws <ArgumentException>(() => SortingJaggedArray.SortingByMinElements(new int[0][]));
public void SortingByMinElementsTests_WithNullArray_ThrowArgumentNullException() => Assert.Throws <ArgumentNullException>(() => SortingJaggedArray.SortingByMinElements(null));