Esempio n. 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @SuppressWarnings("unchecked") @Test public void shouldExpandOnFirstAccess()
        public virtual void ShouldExpandOnFirstAccess()
        {
            // GIVEN
            TraversalBranch     parent = mock(typeof(TraversalBranch));
            Node                source = mock(typeof(Node));
            TraversalBranchImpl branch = new TraversalBranchImpl(parent, source);
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @SuppressWarnings("rawtypes") org.neo4j.graphdb.PathExpander expander = mock(org.neo4j.graphdb.PathExpander.class);
            PathExpander expander = mock(typeof(PathExpander));

            when(expander.expand(eq(branch), any(typeof(BranchState)))).thenReturn(Iterables.emptyResourceIterable());
            TraversalContext context = mock(typeof(TraversalContext));

            when(context.Evaluate(eq(branch), Null)).thenReturn(INCLUDE_AND_CONTINUE);

            // WHEN initializing
            branch.Initialize(expander, context);

            // THEN the branch should not be expanded
            verifyZeroInteractions(source);

            // and WHEN actually traversing from it
            branch.Next(expander, context);

            // THEN we should expand it
            verify(expander).expand(any(typeof(Path)), any(typeof(BranchState)));
        }
Esempio n. 2
0
 public override TraversalBranch Next(PathExpander expander, TraversalContext metadata)
 {
     if (!HasExpandedRelationships())
     {
         ExpandRelationships(expander);
         return(this);
     }
     return(base.Next(expander, metadata));
 }
Esempio n. 3
0
 internal StartNodeTraversalBranch(TraversalContext context, TraversalBranch parent, Node source, InitialBranchState initialState) : base(parent, source, initialState)
 {
     this._initialState = initialState;
     Evaluate(context);
     context.IsUniqueFirst(this);
 }
 protected internal override void Evaluate(TraversalContext context)
 {
     Evaluation = context.Evaluate(this, this);
 }