Skip to content

Commit 845b3fc

Browse files
committed
added failing maxscan test.
1 parent 849c5f5 commit 845b3fc

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/MongoDB.Driver.Tests/MongoCollectionTests.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,6 +1251,17 @@ public void TestFindWithinRectangle()
12511251
// note: the hits are unordered
12521252
}
12531253

1254+
[Test]
1255+
public void TestFindWithMaxScan()
1256+
{
1257+
if (_collection.Exists()) { _collection.Drop(); }
1258+
var docs = Enumerable.Range(0, 10).Select(x => new BsonDocument("_id", x));
1259+
_collection.InsertBatch(docs);
1260+
1261+
var results = _collection.FindAll().SetMaxScan(4).ToList();
1262+
Assert.AreEqual(4, results.Count);
1263+
}
1264+
12541265
[Test]
12551266
public void TestFindWithMaxTime()
12561267
{

0 commit comments

Comments
 (0)