public void TestCollectNodes() { var cu = new CSharpParser().Parse("using System;\nclass Test {\n int field; // comment\n}"); CollectNodesVisitor v = new CollectNodesVisitor(); cu.AcceptVisitor(v); Assert.AreEqual(cu.DescendantsAndSelf.ToList(), v.nodes); }
public void TestCollectNodes() { var cu = new CSharpParser().Parse("using System;\nclass Test {\n int field; // comment\n}"); CollectNodesVisitor v = new CollectNodesVisitor(); cu.AcceptVisitor(v); Assert.AreEqual(cu.DescendantsAndSelf.ToList(), v.nodes); }