예제 #1
0
 protected internal override Relationship fetchNextOrNull()
 {
     while (_pathIterator.MoveNext())
     {
         Path path = _pathIterator.Current;
         if (path.Length() > 0)
         {
             return(path.LastRelationship());
         }
     }
     return(null);
 }
예제 #2
0
        private void AssertPathIsCorrect(Path path)
        {
            Node         a   = Node("A");
            Relationship to1 = GetFistRelationship(a);
            Node         b   = to1.EndNode;
            Relationship to2 = GetFistRelationship(b);
            Node         c   = to2.EndNode;
            Relationship to3 = GetFistRelationship(c);
            Node         d   = to3.EndNode;
            Relationship to4 = GetFistRelationship(d);
            Node         e   = to4.EndNode;

            assertEquals(( int? )4, ( int? )path.Length());
            assertEquals(a, path.StartNode());
            assertEquals(e, path.EndNode());
            assertEquals(to4, path.LastRelationship());

            AssertContainsInOrder(path, a, to1, b, to2, c, to3, d, to4, e);
            AssertContainsInOrder(path.Nodes(), a, b, c, d, e);
            AssertContainsInOrder(path.Relationships(), to1, to2, to3, to4);
            AssertContainsInOrder(path.ReverseNodes(), e, d, c, b, a);
            AssertContainsInOrder(path.ReverseRelationships(), to4, to3, to2, to1);
        }