public void IntEnumTest() { using (IntFieldEnumerator ife = new IntFieldEnumerator(reader, "string", FieldParser.String)) { int value = 0; foreach (int i in ife.Terms) { foreach (int doc in ife.Docs) { int expected = Int32.Parse(reader.Document(doc).Get("string")); Assert.AreEqual(expected, i); } value++; } Assert.AreEqual(1000, value); } using (IntFieldEnumerator ife = new IntFieldEnumerator(reader, "int", FieldParser.Numeric)) { int value = 0; foreach (int i in ife.Terms) { foreach (int doc in ife.Docs) { int expected = Int32.Parse(reader.Document(doc).Get("int")); Assert.AreEqual(expected, i); } value++; } Assert.AreEqual(1000, value); } }