public void NullComparatorNegativeTest() { JaggedArraySortingClass.MyComparator comp = null; Assert.Throws <ArgumentNullException>(() => JaggedArraySortingClass.BubbleSortWithComparator(actualArray1, comp, ascending: true)); Assert.Throws <ArgumentNullException>(() => JaggedArraySortingClass.BubbleSortWithComparator(actualArray1, comp, ascending: false)); }
public void EmptyArrayNegativeTest() { JaggedArraySortingClass.MyComparator comp = new MinRowValueComparator().Compare; Assert.Throws <ArgumentException>(() => JaggedArraySortingClass.BubbleSortWithComparator(new int[][] { }, comp, ascending: true)); Assert.Throws <ArgumentException>(() => JaggedArraySortingClass.BubbleSortWithComparator(new int[][] { }, comp, ascending: false)); }
public void NullParameterNegativeTest() { JaggedArraySortingClass.MyComparator comp = new MinRowValueComparator().Compare; Assert.Throws <ArgumentNullException>(() => JaggedArraySortingClass.BubbleSortWithComparator(null, comp, ascending: true)); Assert.Throws <ArgumentNullException>(() => JaggedArraySortingClass.BubbleSortWithComparator(null, comp, ascending: false)); }
public void RowSumDescendingSort() { JaggedArraySortingClass.BubbleSortByRowSum(actualArray1, false); Assert.AreEqual(expectedArray1, actualArray1); JaggedArraySortingClass.BubbleSortByRowSum(actualArray2, false); Assert.AreEqual(expectedArrayForSumDescendingSort, actualArray2); }
public void RowMaxValueDescendingSort() { JaggedArraySortingClass.BubbleSortByMaxRowValue(actualArray1, false); Assert.AreEqual(expectedArray1, actualArray1); JaggedArraySortingClass.BubbleSortByMaxRowValue(actualArray2, false); Assert.AreEqual(expectedArrayForMaxValueDescendingSort, actualArray2); }
public void RowMinValueAscendingSort() { JaggedArraySortingClass.BubbleSortByMinRowValue(actualArray1, true); Assert.AreEqual(expectedArray1, actualArray1); JaggedArraySortingClass.BubbleSortByMinRowValue(actualArray2, true); Assert.AreEqual(expectedArrayForMinValueAscendingSort, actualArray2); }
public void RowSumAscendingSort() { JaggedArraySortingClass.MyComparator comp = new RowSumComparator().Compare; JaggedArraySortingClass.BubbleSortWithComparator(actualArray1, comp, true); Assert.AreEqual(expectedArray1, actualArray1); JaggedArraySortingClass.BubbleSortWithComparator(actualArray2, comp, true); Assert.AreEqual(expectedArrayForSumAscendingSort, actualArray2); }
public void RowMaxValueDescendingSort() { JaggedArraySortingClass.MyComparator comp = new MaxRowValueComparator().Compare; JaggedArraySortingClass.BubbleSortWithComparator(actualArray1, comp, false); Assert.AreEqual(expectedArray1, actualArray1); JaggedArraySortingClass.BubbleSortWithComparator(actualArray2, comp, false); Assert.AreEqual(expectedArrayForMaxValueDescendingSort, actualArray2); }
public void EmptyArrayNegativeTest() { Assert.Throws <ArgumentException>(() => JaggedArraySortingClass.BubbleSortByRowSum(new int[][] { }, ascending: true)); Assert.Throws <ArgumentException>(() => JaggedArraySortingClass.BubbleSortByRowSum(new int[][] { }, ascending: false)); }
public void NullParameterNegativeTest() { Assert.Throws <ArgumentNullException>(() => JaggedArraySortingClass.BubbleSortByRowSum(null, ascending: true)); Assert.Throws <ArgumentNullException>(() => JaggedArraySortingClass.BubbleSortByRowSum(null, ascending: false)); }