Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

40 development #375

Merged
merged 10 commits into from
Sep 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Neo4jClient.Tests/Cypher/CypherFluentQueryAdvancedTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ public async Task ReturnColumnAlias()

var cypher = new CypherFluentQuery(client);
var results = cypher
.Start("a", (NodeReference) 1)
.Match("a")
.Advanced.Return<ReturnPropertyQueryResult>(new ReturnExpression
{
ResultFormat = CypherResultFormat.DependsOnEnvironment,
ResultMode = CypherResultMode.Projection,
Text = "a.Age AS SomethingTotallyDifferent"
});
Assert.Equal($"START a=node(1){Environment.NewLine}RETURN a.Age AS SomethingTotallyDifferent", results.Query.DebugQueryText);
Assert.Equal($"MATCH a{Environment.NewLine}RETURN a.Age AS SomethingTotallyDifferent", results.Query.DebugQueryText);
Assert.IsAssignableFrom<IEnumerable<ReturnPropertyQueryResult>>(await results.ResultsAsync);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@ public void CreateNodeWithValuesViaCreateUnique()
var client = Substitute.For<IRawGraphClient>();
client.ServerVersion.Returns(new Version(1, 8));
var query = new CypherFluentQuery(client)
.Start("root", (NodeReference)2)
.Match("root")
.CreateUnique("root-[:X]-(leaf {name:'D'} )")
.Return<object>("leaf")
.Query;

Assert.Equal($"START root=node($p0){Environment.NewLine}CREATE UNIQUE root-[:X]-(leaf {{name:'D'}} ){Environment.NewLine}RETURN leaf", query.QueryText);
Assert.Equal(2l, query.QueryParameters["p0"]);
Assert.Equal($"MATCH root{Environment.NewLine}CREATE UNIQUE root-[:X]-(leaf {{name:'D'}} ){Environment.NewLine}RETURN leaf", query.QueryText);
}

[Fact]
Expand All @@ -38,14 +37,12 @@ public void CreateNodeWithValuesViaCreateUniqueAfterMatch()
var client = Substitute.For<IRawGraphClient>();
client.ServerVersion.Returns(new Version(1, 8));
var query = new CypherFluentQuery(client)
.Start("root", (NodeReference)2)
.Match("root-[:X]-foo")
.CreateUnique("foo-[:Y]-(leaf {name:'D'} )")
.Return<object>("leaf")
.Query;

Assert.Equal($"START root=node($p0){Environment.NewLine}MATCH root-[:X]-foo{Environment.NewLine}CREATE UNIQUE foo-[:Y]-(leaf {{name:'D'}} ){Environment.NewLine}RETURN leaf", query.QueryText);
Assert.Equal(2l, query.QueryParameters["p0"]);
Assert.Equal($"MATCH root-[:X]-foo{Environment.NewLine}CREATE UNIQUE foo-[:Y]-(leaf {{name:'D'}} ){Environment.NewLine}RETURN leaf", query.QueryText);
}
}
}
Loading