Exemplo n.º 1
0
        public void ScriptRewriter_Returns_Original_Script(string inputFileName)
        {
            var template = LoadTemplate(inputFileName);

            var rewriter = new TestCloneScriptRewriter();
            var result   = rewriter.Visit(template.Page);

            // The base ScriptRewriter never changes any node, so we should end up with the same instance
            Assert.AreNotSame(template.Page, result);
        }
Exemplo n.º 2
0
        public void LeafCopyScriptRewriter_Returns_Identical_Script(string inputFileName)
        {
            var template = LoadTemplate(inputFileName);

            var rewriter = new TestCloneScriptRewriter();
            var result   = rewriter.Visit(template.Page);

            // This rewriter makes copies of leaf nodes instead of returning the original nodes,
            // so we should end up with another instance identical to the original.
            Assert.AreNotSame(template.Page, result);
            Assert.AreEqual(ToText(template.Page), ToText(result));
        }