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
 internal StartNodeTraversalBranch(TraversalContext context, TraversalBranch parent, Node source, InitialBranchState initialState) : base(parent, source, initialState)
 {
     this._initialState = initialState;
     Evaluate(context);
     context.IsUniqueFirst(this);
 }
Esempio n. 3
0
 protected internal override bool includePath(Path path, TraversalBranch startPath, TraversalBranch endPath)
 {
     assertEquals(0, startPath.State());
     assertEquals(10, endPath.State());
     return(true);
 }
 public override Evaluation evaluate <STATE>(TraversalBranch branch, BranchState <STATE> state)
 {
     return(null);
 }
 public override bool isUnique(TraversalBranch branch)
 {
     return(false);
 }
 public TraversalBranchWithState(TraversalBranch parent, Node source, InitialBranchState initialState) : base(parent, source)
 {
     this.StateForMe = this.StateForChildren = initialState.initialState(this);
 }
 public TraversalBranchWithState(TraversalBranch parent, int depth, Node source, Relationship toHere, object inheritedState) : base(parent, depth, source, toHere)
 {
     this.StateForMe = this.StateForChildren = inheritedState;
 }