Lucene.Net.Analysis.TestNumericTokenStream.TestIntStream C# (CSharp) Method

TestIntStream() private method

private TestIntStream ( ) : void
return void
		public virtual void  TestIntStream()
		{
			NumericTokenStream stream = new NumericTokenStream().SetIntValue(ivalue);
			// use getAttribute to test if attributes really exist, if not an IAE will be throwed
            ITermAttribute termAtt = stream.GetAttribute<ITermAttribute>();
            ITypeAttribute typeAtt = stream.GetAttribute<ITypeAttribute>();
			for (int shift = 0; shift < 32; shift += NumericUtils.PRECISION_STEP_DEFAULT)
			{
				Assert.IsTrue(stream.IncrementToken(), "New token is available");
				Assert.AreEqual(NumericUtils.IntToPrefixCoded(ivalue, shift), termAtt.Term, "Term is correctly encoded");
				Assert.AreEqual((shift == 0)?NumericTokenStream.TOKEN_TYPE_FULL_PREC:NumericTokenStream.TOKEN_TYPE_LOWER_PREC, typeAtt.Type, "Type correct");
			}
			Assert.IsFalse(stream.IncrementToken(), "No more tokens available");
		}