//[Description("http://docs.neo4j.org/chunked/2.0.0-M01/query-start.html#start-relationship-by-index-lookup")] public void RelationshipByIndexLookup() { var cypher = ToCypher(new { r = Relationship.ByIndexLookup("someIndex", "name", "A") }); Assert.Equal("r=relationship:`someIndex`(name = {p0})", cypher.QueryText); Assert.Equal(1, cypher.QueryParameters.Count); Assert.Equal("A", cypher.QueryParameters["p0"]); }
public void Mixed() { var nodeRef = (NodeReference)2; var relRef = (RelationshipReference)3; var relRef2 = (RelationshipReference)4; var cypher = ToCypher(new { n1 = "custom", n2 = nodeRef, n3 = Node.ByIndexLookup("indexName", "property", "value"), n4 = Node.ByIndexQuery("indexName", "query"), r1 = relRef, moreRels = new[] { relRef, relRef2 }, r2 = Relationship.ByIndexLookup("indexName", "property", "value"), r3 = Relationship.ByIndexQuery("indexName", "query"), all = All.Nodes }); const string expected = "n1=custom, " + "n2=node({p0}), " + "n3=node:`indexName`(property = {p1}), " + "n4=node:`indexName`({p2}), " + "r1=relationship({p3}), " + "moreRels=relationship({p4}), " + "r2=relationship:`indexName`(property = {p5}), " + "r3=relationship:`indexName`({p6}), " + "all=node(*)"; Assert.Equal(expected, cypher.QueryText); Assert.Equal(7, cypher.QueryParameters.Count); Assert.Equal(2L, cypher.QueryParameters["p0"]); Assert.Equal("value", cypher.QueryParameters["p1"]); Assert.Equal("query", cypher.QueryParameters["p2"]); Assert.Equal(3L, cypher.QueryParameters["p3"]); Assert.Equal(new[] { 3L, 4L }, cypher.QueryParameters["p4"]); Assert.Equal("value", cypher.QueryParameters["p5"]); Assert.Equal("query", cypher.QueryParameters["p6"]); }