public void TestConditionalVisitor() { var predicate = new ConditionalVisitor(p => p.IsLeaf && p.Name.IndexOf("NAME") > -1); _base.Accept(predicate); Assert.IsTrue(predicate.Results.Count > 0); foreach (var s in predicate.Results) { Console.WriteLine("{0}={1}", s, _base.GetValue(s)); } var expressionVisitor = new NameExpressionVisitor("ADDRESS"); _base.Accept(expressionVisitor); Assert.IsTrue(expressionVisitor.Results.Count > 0); foreach (var s in expressionVisitor.Results) { Console.WriteLine("{0}={1}", s, _base.GetValue(s)); } }