public void ShouldReturnNullIfCountIsZeroForTypedLuceneQueryResult()
        {
            var result = new LuceneQueryResult <object>(
                new LuceneQuery(), new LuceneResultRow[0], 0, 3, 0, default(TimeSpan), default(TimeSpan), 0, 0, StubConvertor);

            Assert.Null(result.NextPageQuery);
        }
        public void ShouldReturnNullIfTotalCountAndCountAreEqualForTypedLuceneQueryResult()
        {
            var result = new LuceneQueryResult <object>(
                new LuceneQuery(), new LuceneResultRow[3], 3, 0, default(TimeSpan), default(TimeSpan), 0, 0, StubConvertor);

            Assert.Null(result.NextPageQuery);
        }
        public void ShouldReturnNextPageQueryForLuceneQueryResult()
        {
            var result = new LuceneQueryResult<object>(
                new LuceneQuery { DesignDocumentName = "dd", IndexName = "someIndex", Query = "test:query", Limit = 2 },
                new[] {
                    new LuceneResultRow("54e39b4a6d9442c6bd2032e6b12fec5d", "field-value".ToJsonFragment(), 0, null, null),
                    new LuceneResultRow("db7df2f7a0da4a24923ac2a02b9cb7f7", "field-value".ToJsonFragment(), 0, null, null)
                },
                totalCount: 3,
                offset: 0,
                fetchDuration: default(TimeSpan),
                searchDuration: default(TimeSpan),
                limit: 2,
                skip: 0,
                rowConvertor: StubConvertor);

            Assert.Equal(2, result.NextPageQuery.Skip);
            Assert.Equal(2, result.NextPageQuery.Limit);
        }
        public void ShouldUseLimitAndSkipReturnedWithResult()
        {
            var result = new LuceneQueryResult <object>(
                new LuceneQuery {
                DesignDocumentName = "dd", IndexName = "someIndex", Query = "test:query", Limit = 100500, Skip = 2
            },
                new[] {
                new LuceneResultRow("54e39b4a6d9442c6bd2032e6b12fec5d", "field-value".ToJsonFragment(), 0, null, null),
                new LuceneResultRow("db7df2f7a0da4a24923ac2a02b9cb7f7", "field-value".ToJsonFragment(), 0, null, null)
            },
                totalCount: 3,
                offset: 0,
                fetchDuration: default(TimeSpan),
                searchDuration: default(TimeSpan),
                limit: 2,
                skip: 0,
                rowConvertor: StubConvertor);

            Assert.Equal(0 + 2, result.NextPageQuery.Skip);
            Assert.Equal(2, result.NextPageQuery.Limit);
        }
 public void ShouldReturnNullIfTotalCountAndCountAreEqualForUntypedLuceneQueryResult()
 {
     var result = new LuceneQueryResult(new LuceneQuery(), new LuceneResultRow[3], 3, 0, default(TimeSpan), default(TimeSpan), 0, 0);
     Assert.Null(result.NextPageQuery);
 }
 public void ShouldReturnNullIfCountIsZeroForUntypedLuceneQueryResult()
 {
     var result = new LuceneQueryResult(new LuceneQuery(), new LuceneResultRow[0], 0, 3, 0, default(TimeSpan), default(TimeSpan), 0, 0);
     Assert.Null(result.NextPageQuery);
 }
 public void ShouldReturnNullIfCountIsZeroForTypedLuceneQueryResult()
 {
     var result = new LuceneQueryResult<object>(
         new LuceneQuery(), new LuceneResultRow[0], 0, 3, 0, default(TimeSpan), default(TimeSpan), 0, 0, StubConvertor);
     Assert.Null(result.NextPageQuery);
 }
        public void ShouldReturnNullIfCountIsZeroForUntypedLuceneQueryResult()
        {
            var result = new LuceneQueryResult(new LuceneQuery(), new LuceneResultRow[0], 0, 3, 0, default(TimeSpan), default(TimeSpan), 0, 0);

            Assert.Null(result.NextPageQuery);
        }