Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            JuggedArray array = new JuggedArray(intArray);

            array.DescendingSortByMinElement();
            Console.WriteLine(array);
        }
        public void DescendingSortByStringSumTest()
        {
            JuggedArray array = new JuggedArray(intArray);

            int[][] expected = new int[][]
            {
                new int[] { -10, 6, 4, 50 },
                new int[] { 0, 11, 12 },
                new int[] { 1, 6, 9 },
                new int[] { -1, -5, 2, 7, 9 },
                new int[] {},
                new int[] { 0 }
            };

            CollectionAssert.AreEqual(expected, array.DescendingSortByStringSum());
        }
        public void AscendingSortByMinElementTest()
        {
            JuggedArray array = new JuggedArray(intArray);

            int[][] expected = new int[][]
            {
                new int[] { -10, 6, 4, 50 },
                new int[] { -1, -5, 2, 7, 9 },
                new int[] { 0 },
                new int[] { 0, 11, 12 },
                new int[] { 1, 6, 9 },
                new int[] {}
            };

            CollectionAssert.AreEqual(expected, array.AscendingSortByMinElement());
        }