[ 
https://issues.apache.org/jira/browse/LUCENENET-97?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12523709
 ] 

Neal Granroth commented on LUCENENET-97:
----------------------------------------

Correction:

The test section for verifying that Current does not alter the position 
requires a MoveNext(),
as documented in .NET System.Collections.IEnumerator "the initial position is 
before the first element of the collection".  So replace the list 13 lines with:

// ..................

HitIterator iterator2 = (HitIterator) hits.Iterator(); 

iterator2.MoveNext();

Hit hit = (Hit) iterator2.Current;
Assert.AreEqual("iterator test doc 1", hit.Get("field"));

// Verify that "Current" does not move, when MoveNext is not called.

Hit hitAgain = (Hit) iterator2.Current;
Assert.AreEqual("iterator test doc 1", hitAgain.Get("field")); 



> HitIterator does not correctly implement System.Collections.IEnumerator
> -----------------------------------------------------------------------
>
>                 Key: LUCENENET-97
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-97
>             Project: Lucene.Net
>          Issue Type: Bug
>         Environment: .NET
>            Reporter: Neal Granroth
>
> method MoveNext() is supposed to increment the position within the list; it 
> does not.
> method Current() is supposed to return the object at the current position, 
> but not change the position within the list.
> It incorrectly moves to the next position.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to