示例#1
0
        public void GivenMatrixWithMoreColumsThanRowsWhenTraverseThenReturnValidResult()
        {
            //Given
            string[,] matrix =
            {
                { "a", "b", "c", "d" },
                { "e", "f", "g", "h" },
                { "i", "j", "k", "l" }
            };
            //When
            string result = ArrayTraversal.TraverseMatrixDiagonally(matrix);

            //Then
            Assert.Equal("aebifcjgdkhl", result);
        }
示例#2
0
        public void GivenValidMatrixWhenTraverseThenReturnValidResult()
        {
            //Given
            string[,] matrix =
            {
                { "a", "b", "c" },
                { "d", "e", "f" },
                { "g", "h", "i" }
            };

            //When
            string result = ArrayTraversal.TraverseMatrixDiagonally(matrix);

            //Then
            Assert.Equal("adbgechfi", result);
        }
示例#3
0
        public void GivenAnMatrixWithMoreRowsThanColumsWhenTraverseThenReturnValidResult()
        {
            //Given
            string[,] matrix =
            {
                { "a", "b", "c" },
                { "d", "e", "f" },
                { "g", "h", "i" },
                { "j", "k", "l" }
            };
            //When
            string result = ArrayTraversal.TraverseMatrixDiagonally(matrix);

            //Then
            Assert.Equal("adbgecjhfkil", result);
        }