public void ArraySort_ValidData_MaxAscending_Test() { int[][] arr1 = { new[] { 1, -2, 7, -4 }, new[] { 5, -2, -4, -3 }, new[] { 2, 5, -3 } }; int[][] resultArr1 = { new[] { 5, -2, -4, -3 }, new[] { 2, 5, -3 }, new[] { 1, -2, 7, -4 } }; CollectionAssert.AreEqual(resultArr1, ArraySortDelegate.BubleSort(arr1, new MaxElementComparer(true).Compare)); }
public void ArraySort_ValidData_SumDescending_Test() { int[][] arr1 = { new[] { 1, -2, 7, -4 }, new[] { 5, -2, -4, -3 }, new[] { 2, 5, -3 } }; int[][] resultArr1 = { new[] { 2, 5, -3 }, new[] { 1, -2, 7, -4 }, new[] { 5, -2, -4, -3 } }; CollectionAssert.AreEqual(ArraySortDelegate.BubleSort(arr1, new SumElementComparer(false).Compare), resultArr1); }
public void ArraySort_InvalidData_Test(int[][] arg1) { Assert.Throws <ArgumentNullException>(() => ArraySortDelegate.BubleSort(arg1, new SumElementComparer(false).Compare)); }