Exemple #1
0
        public void MethodSort_MinElemComparerAscending_ReturnSortedArray()
        {
            int[][] array =
            {
                new int[] {  5,  3, 1, 7, 9 },
                new int[] {  4,  0, 2,6 },
                new int[] { 22, 33, 11 }
            };

            int[][] expected =
            {
                new int[] {  4,  0, 2, 6 },
                new int[] {  5,  3, 1,7, 9 },
                new int[] { 22, 33, 11 }
            };

            InterfaceDelegate.Sort(array, new MinElemAscendingComparer());

            CollectionAssert.AreEqual(expected, array);
        }
Exemple #2
0
 public void MethodSort_OneOfArrayLengthZero_ArgumentExcepton()
 {
     Assert.Throws <ArgumentException>(() => InterfaceDelegate.Sort(new int[][] { new int[] { } }, new SumAscendingComparer()));
 }
Exemple #3
0
 public void MethodSort_NullArray_ArgumentNullExcepton()
 {
     Assert.Throws <ArgumentNullException>(() => InterfaceDelegate.Sort(null, new SumAscendingComparer()));
 }