public void Adds_Criteria_For_NodeType() { var queryString = "news"; var tree = ParseTree(queryString); var visitor = new LuceneQueryParser(); var query = visitor.Execute((IVisitable)tree.Root.AstNode); Assert.That(query.ToString(), Is.EqualTo("+__nodeType:news")); }
public void Adds_Order_And_Limit() { var queryString = "latest 1 news"; var tree = ParseTree(queryString); var visitor = new LuceneQueryParser(); visitor.Execute((IVisitable)tree.Root.AstNode); Assert.That(visitor.Limit, Is.EqualTo(1)); Assert.That(visitor.Sort.GetSort()[0].GetField(), Is.EqualTo("__created")); }