Beispiel #1
0
 private void Execute(TraversalDescription traversal, Uniqueness uniqueness)
 {
     using (Transaction transaction = BeginTx())
     {
         Traverser traverser = traversal.Uniqueness(uniqueness).traverse(Node("1"));
         assertNotEquals("empty traversal", 0, Iterables.count(traverser));
     }
 }
Beispiel #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void traverseThroughNodeWithLoop()
        public virtual void TraverseThroughNodeWithLoop()
        {
            /*
             * (a)-->(b)-->(c)-->(d)-->(e)
             *             /  \ /  \
             *             \__/ \__/
             */

            CreateGraph("a TO b", "b TO c", "c TO c", "c TO d", "d TO d", "d TO e");

            using (Transaction tx = BeginTx())
            {
                Node a = GetNodeWithName("a");
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.neo4j.graphdb.Node e = getNodeWithName("e");
                Node                 e              = GetNodeWithName("e");
                Evaluator            onlyEndNode    = path => Evaluation.ofIncludes(path.endNode().Equals(e));
                TraversalDescription basicTraverser = GraphDb.traversalDescription().evaluator(onlyEndNode);
                ExpectPaths(basicTraverser.Traverse(a), "a,b,c,d,e");
                ExpectPaths(basicTraverser.Uniqueness(Uniqueness.RELATIONSHIP_PATH).traverse(a), "a,b,c,d,e", "a,b,c,c,d,e", "a,b,c,d,d,e", "a,b,c,c,d,d,e");
                tx.Success();
            }
        }