Ejemplo n.º 1
0
        public void SortByMaxInRowTest()
        {
            // Arrange
            int[][] actual = new int[][]
            {
                new int[] { 1, 3, 5, 7, 9 },
                new int[] { 11, 25, 99 },
                new int[] { 11, 22 },
                new int[] { 0, 2, 4, 6 }
            };

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

            // Act
            JaggedArray.SortByMaxInRow(actual);

            // Assert
            for (int i = 0; i < actual.Length; i++)
            {
                CollectionAssert.AreEqual(expected[i], actual[i]);
            }
        }