public void BubbleSortOfDecreasingSumElemInLineTest_ReturnSortingArray() { // Assert int[][] InputJagArr = new int[][] { new int[] { 1, 3, 5, 7, 9 }, null, new int[] { 0, 2, 4, 6 }, new int[] { 11, 22 }, null, new int[] { 1, 48 }, new int[] { 1, 1, 1, 21 } }; int[][] ExpectedJagArr = new int[][] { new int[] { 1, 48 }, new int[] { 11, 22 }, new int[] { 1, 3, 5, 7, 9 }, new int[] { 1, 1, 1, 21 }, new int[] { 0, 2, 4, 6 }, null, null }; // Act Comparator comparator = new SumArrayDecrComparer().Compare; BubbleSortJagArrDelegateCaptInterface.BubbleSort(InputJagArr, comparator); // Assert CollectionAssert.AreEqual(ExpectedJagArr, InputJagArr); }
public void SortOfIncreasingMaxElemInLineTest_ReturnSortingArray() { // Assert int[][] inputJagArr = new int[][] { new int[] { 1, 3, 5, 7, 9 }, new int[] { 0, 2, 4, 6 }, null, new int[] { 11, 22 }, null, new int[] { 1, 48 }, new int[] { 1, 1, 1, 9952 } }; int[][] expectedJagArr = new int[][] { null, null, new int[] { 0, 2, 4, 6 }, new int[] { 1, 3, 5, 7, 9 }, new int[] { 11, 22 }, new int[] { 1, 48 }, new int[] { 1, 1, 1, 9952 }, }; // Act Comparator comparator = new MaxArrayLineIncrComparer().Compare; BubbleSortJagArrDelegateCaptInterface.BubbleSort(inputJagArr, comparator); // Assert CollectionAssert.AreEqual(expectedJagArr, inputJagArr); }
public void BubbleSortSumElemInLineTest_ThrowsArgumentNullException() => Assert.Throws <ArgumentNullException>(() => BubbleSortJagArrDelegateCaptInterface.BubbleSort(null, compar));