Example #1
0
        public void TransformTreeUsingSyntaxRewriter()
        {
            string     text    = "class C { void M() { } int field; }";
            SyntaxTree tree    = SyntaxFactory.ParseSyntaxTree(text);
            SyntaxNode newRoot = new RemoveMethodsRewriter().Visit(tree.GetRoot());

            Assert.Equal("class C { int field; }", newRoot.ToFullString());
        }
Example #2
0
 public void TransformTreeUsingSyntaxRewriter()
 {
     string text = "class C { void M() { } int field; }";
     SyntaxTree tree = SyntaxFactory.ParseSyntaxTree(text);
     SyntaxNode newRoot = new RemoveMethodsRewriter().Visit(tree.GetRoot());
     Assert.Equal("class C { int field; }", newRoot.ToFullString());
 }