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

TestLongStream() private method

private TestLongStream ( ) : void
return void
		public virtual void  TestLongStream()
		{
			NumericTokenStream stream = new NumericTokenStream().SetLongValue(lvalue);
			// 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 < 64; shift += NumericUtils.PRECISION_STEP_DEFAULT)
			{
				Assert.IsTrue(stream.IncrementToken(), "New token is available");
				Assert.AreEqual(NumericUtils.LongToPrefixCoded(lvalue, 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");
		}