Skip to content

Commit

Permalink
adds test for skip
Browse files Browse the repository at this point in the history
  • Loading branch information
Shazwazza committed Jun 18, 2015
1 parent d5e09a6 commit bd40f14
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Projects/Examine.Test/Search/FluentApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,26 @@ public void FluentApi_Max_Results()
Assert.AreEqual(10, results.TotalItemCount);
}

[Test]
public void FluentApi_Skip_Results()
{
var searcher = (BaseLuceneSearcher)_searcher;
var criteria = searcher.CreateSearchCriteria(BooleanOperation.Or);
var filter = criteria
.Field(LuceneIndexer.IndexTypeFieldName, "media")
.Or()
.Field(LuceneIndexer.IndexTypeFieldName, "content")
.Compile();

var results = searcher.Search(filter, 5);

var skipped = results.Skip(0).Take(3);
Assert.AreEqual(3, skipped.Count());

skipped = results.Skip(3).Take(3);
Assert.AreEqual(2, skipped.Count());
}

[Test]
public void FluentApi_Find_By_NodeTypeAlias()
{
Expand Down

0 comments on commit bd40f14

Please sign in to comment.