-
Notifications
You must be signed in to change notification settings - Fork 1
/
RelationshipTests.kt
37 lines (29 loc) · 1.19 KB
/
RelationshipTests.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import QueryObjects.Relationship.PathLength.Ranges.ANY
class RelationshipTests {
fun perform() {
println("------------------RELATIONSHIP TESTS------------------")
val rel = relationship("m", "MARRIED"){ "when" value "longAgo" }
DSLTest("NamedRelationship", rel, "[m:MARRIED {when: 'longAgo'}]")
val alena = node("a", "Alena")
val boris = node("b", "Boris")
var req1 = match {
alena has rel to boris
}
DSLTest("MatchRelationship", req1, "MATCH (a:Alena)-[m:MARRIED {when: 'longAgo'}]->(b:Boris)")
req1 = match {
alena has relationship() to boris
}
DSLTest("EmptyRelationship", req1, "MATCH (a:Alena)-->(b:Boris)")
var req2 = create {
val e = node ("e", "E")
val f = node ("f", "F")
val someRel = relationship(type="REL")
e has someRel to f
}
DSLTest("DescribedUnitsInside", req2, "CREATE (e:E)-[:REL]->(f:F)")
req2 = create {
node("me") has relationship(type="KNOWS") [ANY upTo 2] to node("remoteFriend")
}
DSLTest("FullyDescribed", req2, "CREATE (me)-[:KNOWS*..2]->(remoteFriend)")
}
}