Exemplo n.º 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void singularNodeWorksForwardsAndBackwards()
        internal virtual void SingularNodeWorksForwardsAndBackwards()
        {
            Node node = CreateNode(1337L);
            Path path = PathImpl.Singular(node);

            assertEquals(node, path.StartNode());
            assertEquals(node, path.EndNode());

            IEnumerator <Node> forwardIterator = path.Nodes().GetEnumerator();

//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            assertTrue(forwardIterator.hasNext());
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            assertEquals(node, forwardIterator.next());
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            assertFalse(forwardIterator.hasNext());

            IEnumerator <Node> reverseIterator = path.ReverseNodes().GetEnumerator();

//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            assertTrue(reverseIterator.hasNext());
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            assertEquals(node, reverseIterator.next());
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            assertFalse(reverseIterator.hasNext());
        }
Exemplo n.º 2
0
 public IteratorAnonymousInnerClass(PathImpl outerInstance, Node start, IEnumerable <Relationship> relationships)
 {
     this.outerInstance   = outerInstance;
     this._start          = start;
     this._relationships  = relationships;
     current              = start;
     relationshipIterator = relationships.GetEnumerator();
 }
Exemplo n.º 3
0
 public IteratorAnonymousInnerClass2(PathImpl outerInstance)
 {
     this.outerInstance = outerInstance;
     current            = outerInstance.Nodes().GetEnumerator();
     next = outerInstance.Relationships().GetEnumerator();
 }