Exemplo n.º 1
0
        public void RotateMatrixTest()
        {
            var symbol           = ',';
            var matrixOperations = new MatrixOperations(symbol);
            var matrix           = new[]
            {
                new[] { "25", "38", "12" }
                , new[] { "1", "7", "76" }
                , new[] { "21", "64", "54" }
            };
            var matrix90       = matrixOperations.GetRotatedMatrix(matrix);
            var matrix180      = matrixOperations.GetRotatedMatrix(matrix90);
            var rotatedMatrix  = matrixOperations.GetRotatedMatrix(matrix180);
            var expextedMatrix = new[]
            {
                new[] { "12", "76", "54" }
                , new[] { "38", "7", "64" }
                , new[] { "25", "1", "21" }
            };


            Assert.AreEqual(rotatedMatrix, expextedMatrix);
        }