public void BubbleSortDelegate_ComparerByMinASC_EqualToResult(int[][] array, int[][] result) { JaggedArraySortWithDelegate.BubbleSort(array, (x, y) => x.Min().CompareTo(y.Min())); Assert.True(array.EqualTo(result)); }
public void BubbleSort_NullReferenceComparer_ArgumentNullException() { ByMaxElementASC comparer = null; Assert.Throws <ArgumentNullException>(() => JaggedArraySortWithDelegate.BubbleSort(new int[][] { }, comparer)); }
public void BubbleSort_NullReferenceArray_ArgumentNullException() { Assert.Throws <ArgumentNullException>(() => JaggedArraySortWithDelegate.BubbleSort(null, new ByMaxElementDESC())); }
public void BubbleSort_JaggedArrayWithNullArray_EqualToResult(int[][] array, int[][] result) { JaggedArraySortWithDelegate.BubbleSort(array, new BySumElementsASC()); Assert.True(array.EqualTo(result)); }
public void BubbleSort_ComparerByMaxDESC_EqualToResult(int[][] array, int[][] result) { JaggedArraySortWithDelegate.BubbleSort(array, new ByMaxElementDESC()); Assert.True(array.EqualTo(result)); }
public void BubbleSortDelegate_JaggedArrayWithNullArray_EqualToResult(int[][] array, int[][] result) { JaggedArraySortWithDelegate.BubbleSort(array, (x, y) => x.Sum().CompareTo(y.Sum())); Assert.True(array.EqualTo(result)); }