Exemple #1
0
        public void GivenMatrixWithMoreColumsThanRowsWhenTraverseDiagonallyInvertedThenReturnValidResult()
        {
            //Given
            string[,] matrix =
            {
                { "a", "b", "c", "d" },
                { "e", "f", "g", "h" },
                { "i", "j", "k", "l" }
            };
            //When
            string result = ArrayTraversalDiagonally.TraverseMatrixInverted(matrix);

            //Then
            Assert.Equal("dhclgbkfajei", result);
        }
Exemple #2
0
        public void GivenMatrixWithMoreRowsThanColumsWhenTraverseInvertedThenReturnValidResult()
        {
            //Given
            string[,] matrix =
            {
                { "a", "b", "c" },
                { "d", "e", "f" },
                { "g", "h", "i" },
                { "j", "k", "l" }
            };
            //When
            string result = ArrayTraversalDiagonally.TraverseMatrixInverted(matrix);

            //Then
            Assert.Equal("cfbiealhdkgj", result);
        }
Exemple #3
0
        public void GivenValidMatrixWhenTraverseDiagonallyInvertedThenReturnValidResult()
        {
            //Given
            string[,] matrix =
            {
                { "a", "b", "c" },
                { "d", "e", "f" },
                { "g", "h", "i" }
            };

            //When
            string result = ArrayTraversalDiagonally.TraverseMatrixInverted(matrix);

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