public void HintTest()
 {
     IDBCollection collection = Mongo.DefaultDatabase["test"];
     IDBIndex idIndex = collection.EnsureIDIndex();
     DBCursorOptions target = new DBCursorOptions(collection, explicitIndexHint:idIndex);
     target.Hint.Should().Be(idIndex);
 }
 public void ExplainTest()
 {
     IDBCollection collection = Mongo.DefaultDatabase["test"];
     DBCursorOptions target = new DBCursorOptions(collection, explain:true);
     target.Explain.Should().BeTrue();
 }
 public void FlagsTest()
 {
     IDBCollection collection = Mongo.DefaultDatabase["test"];
     DBCursorOptions target = new DBCursorOptions(collection, flags:CursorFlags.TailableCursor);
     target.Flags.Should().Be(CursorFlags.TailableCursor);
 }
 public void CollectionTest()
 {
     IDBCollection collection = Mongo.DefaultDatabase["test"];
     DBCursorOptions target = new DBCursorOptions(collection);
     target.Collection.Should().NotBeNull();
 }
 public void DBCursorOptionsConstructorTest()
 {
     IDBCollection collection = Mongo.DefaultDatabase["test"];
     DBCursorOptions target = new DBCursorOptions(collection, DBQuery.SelectAll, DBFieldSet.IDKeyFieldSet, DBFieldSet.IDKeyFieldSet, 2, 40, explain:true, flags:CursorFlags.SlaveOK, explicitIndexHint:collection.EnsureIDIndex());
 }
 public void SnapshotTest()
 {
     IDBCollection collection = Mongo.DefaultDatabase["test"];
     DBCursorOptions target = new DBCursorOptions(collection, snapshot: true);
     target.Snapshot.Should().BeTrue();
 }
 public void SelectorTest()
 {
     IDBCollection collection = Mongo.DefaultDatabase["test"];
     DBCursorOptions target = new DBCursorOptions(collection, selector: DBQuery.SelectAll);
     target.Selector.Count.Should().Be(0);
 }
 public void ReturnFieldsTest()
 {
     IDBCollection collection = Mongo.DefaultDatabase["test"];
     DBFieldSet fieldSet = "tim";
     DBCursorOptions target = new DBCursorOptions(collection, returnFields: fieldSet);
     target.ReturnFields.Keys.Should().Contain("tim");
 }
 public void OrderByTest()
 {
     IDBCollection collection = Mongo.DefaultDatabase["test"];
     DBFieldSet fieldSet = "tim";
     DBCursorOptions target = new DBCursorOptions(collection, orderBy:fieldSet);
     target.OrderBy.Keys.Should().Contain("tim");
 }
Пример #10
0
 public void NumberToSkipTest()
 {
     IDBCollection collection = Mongo.DefaultDatabase["test"];
     DBCursorOptions target = new DBCursorOptions(collection, numberToSkip: 3);
     target.NumberToSkip.Should().Be(3);
 }