コード例 #1
0
        public void SortDescendingSum_CorrectParams_CorrectAnswer()
        {
            int[][] expected = new int[][]
            {
                new int[] { 3, 5, 6 },
                new int[] { 1, 0, 0, 2 },
                new int[] { 0, 0, 0, 0 },
                new int[] { 4, -5, -6, 7 },
                new int[] { 10, -50, 8, 9 },
            };

            My_BubbleSort.BubbleSort(arr, new Comparers.ComparerByDescendingSumElement());
            CollectionAssert.AreEqual(expected, arr);
        }
コード例 #2
0
 public void BubbleSort_NullParams_ArgumentNullException()
 {
     Assert.Throws <ArgumentNullException>(() => My_BubbleSort.BubbleSort(null, new Comparers.ComparerByDescendingMaxElement()));
     Assert.Throws <ArgumentNullException>(() => My_BubbleSort.BubbleSort(arr, (Comparison <int[]>)null));
 }