Lucene.Net.Search.TestTopFieldCollector.TestSortWithScoreNoMaxScoreTrackingMulti C# (CSharp) Method

TestSortWithScoreNoMaxScoreTrackingMulti() private method

private TestSortWithScoreNoMaxScoreTrackingMulti ( ) : void
return void
        public virtual void TestSortWithScoreNoMaxScoreTrackingMulti()
        {
            // Two Sort criteria to instantiate the multi/single comparators.
            Sort[] sort = new Sort[] { new Sort(SortField.FIELD_DOC, SortField.FIELD_SCORE) };
            for (int i = 0; i < sort.Length; i++)
            {
                Query q = new MatchAllDocsQuery();
                TopDocsCollector<Entry> tdc = TopFieldCollector.Create(sort[i], 10, true, true, false, true);

                @is.Search(q, tdc);

                TopDocs td = tdc.TopDocs();
                ScoreDoc[] sd = td.ScoreDocs;
                for (int j = 0; j < sd.Length; j++)
                {
                    Assert.IsTrue(!float.IsNaN(sd[j].Score));
                }
                Assert.IsTrue(float.IsNaN(td.MaxScore));
            }
        }