Skip to content

Commit

Permalink
Merge pull request #147 from KupVadim/master
Browse files Browse the repository at this point in the history
Change OrderByDescending query generation
  • Loading branch information
cskardon committed Jan 20, 2016
2 parents fe019a0 + b2d210b commit da70222
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Neo4jClient.Tests/Cypher/CypherFluentQueryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -297,15 +297,15 @@ public void OrderNodesByMultiplePropertiesDescending()
// http://docs.neo4j.org/chunked/stable/query-order.html#order-by-order-nodes-in-descending-order
// START n=node(3,1,2)
// RETURN n
// ORDER BY n.age, n.name DESC
// ORDER BY n.age DESC, n.name DESC

var client = Substitute.For<IRawGraphClient>();
var query = new CypherFluentQuery(client)
.Return<object>("n")
.OrderByDescending("n.age", "n.name")
.Query;

Assert.AreEqual("RETURN n\r\nORDER BY n.age, n.name DESC", query.QueryText);
Assert.AreEqual("RETURN n\r\nORDER BY n.age DESC, n.name DESC", query.QueryText);
Assert.AreEqual(0, query.QueryParameters.Count);
}

Expand Down
2 changes: 1 addition & 1 deletion Neo4jClient/Cypher/CypherFluentQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ public ICypherFluentQuery OrderBy(params string[] properties)
public ICypherFluentQuery OrderByDescending(params string[] properties)
{
return Mutate(w =>
w.AppendClause(string.Format("ORDER BY {0} DESC", string.Join(", ", properties))));
w.AppendClause(string.Format("ORDER BY {0} DESC", string.Join(" DESC, ", properties))));
}

public CypherQuery Query
Expand Down
2 changes: 1 addition & 1 deletion Neo4jClient/Cypher/CypherFluentQuery`TResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public CypherFluentQuery(IGraphClient client, QueryWriter writer)
public new ICypherFluentQuery<TResult> OrderByDescending(params string[] properties)
{
return Mutate<TResult>(w =>
w.AppendClause(string.Format("ORDER BY {0} DESC", string.Join(", ", properties))));
w.AppendClause(string.Format("ORDER BY {0} DESC", string.Join(" DESC, ", properties))));
}

public IEnumerable<TResult> Results
Expand Down

0 comments on commit da70222

Please sign in to comment.