Beispiel #1
0
 public void BubbleSortDelegate_ComparerByMinASC_EqualToResult(int[][] array, int[][] result)
 {
     JaggedArraySortWithDelegate.BubbleSort(array, (x, y) => x.Min().CompareTo(y.Min()));
     Assert.True(array.EqualTo(result));
 }
Beispiel #2
0
        public void BubbleSort_NullReferenceComparer_ArgumentNullException()
        {
            ByMaxElementASC comparer = null;

            Assert.Throws <ArgumentNullException>(() => JaggedArraySortWithDelegate.BubbleSort(new int[][] { }, comparer));
        }
Beispiel #3
0
 public void BubbleSort_NullReferenceArray_ArgumentNullException()
 {
     Assert.Throws <ArgumentNullException>(() => JaggedArraySortWithDelegate.BubbleSort(null, new ByMaxElementDESC()));
 }
Beispiel #4
0
 public void BubbleSort_JaggedArrayWithNullArray_EqualToResult(int[][] array, int[][] result)
 {
     JaggedArraySortWithDelegate.BubbleSort(array, new BySumElementsASC());
     Assert.True(array.EqualTo(result));
 }
Beispiel #5
0
 public void BubbleSort_ComparerByMaxDESC_EqualToResult(int[][] array, int[][] result)
 {
     JaggedArraySortWithDelegate.BubbleSort(array, new ByMaxElementDESC());
     Assert.True(array.EqualTo(result));
 }
Beispiel #6
0
 public void BubbleSortDelegate_JaggedArrayWithNullArray_EqualToResult(int[][] array, int[][] result)
 {
     JaggedArraySortWithDelegate.BubbleSort(array, (x, y) => x.Sum().CompareTo(y.Sum()));
     Assert.True(array.EqualTo(result));
 }