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()); }