Example #1
0
        public void ReplaceOneWayDataBinds_Properly_Reformats_Tag()
        {
            var inputText      = $"{WebFormsOneWayDataBindStartTag} {NormalExpressionContent} {WebFormsNormalEndTag}";
            var expectedOutput = $"{RazorExplicitBindingStartTag}{NormalExpressionContent}{RazorExplicitBindingEndTag}";
            var actualOutput   = EmbeddedCodeReplacers.ReplaceOneWayDataBinds(inputText);

            Assert.AreEqual(expectedOutput, actualOutput);
        }
Example #2
0
        public static string ConvertEmbeddedCode(string htmlString, string originalFilePath, ViewImportService viewImportService)
        {
            htmlString = EmbeddedCodeReplacers.ReplaceOneWayDataBinds(htmlString);
            htmlString = EmbeddedCodeReplacers.ReplaceRawExprs(htmlString);
            htmlString = EmbeddedCodeReplacers.ReplaceHTMLEncodedExprs(htmlString);
            htmlString = EmbeddedCodeReplacers.ReplaceAspExprs(htmlString);
            htmlString = EmbeddedCodeReplacers.ReplaceAspComments(htmlString);
            htmlString = EmbeddedCodeReplacers.ReplaceEmbeddedCodeBlocks(htmlString);

            return(htmlString);
        }