@@ -1408,6 +1408,7 @@ public void FindOneAndUpdate_with_Projection_As_should_execute_correctly(
1408
1408
[ ParameterAttributeData ]
1409
1409
public void Indexes_CreateOne_should_execute_a_CreateIndexesOperation(
1410
1410
[ Values ( false , true ) ] bool usingSession,
1411
+ [ Values ( false , true ) ] bool usingCreateOneIndexOptions,
1411
1412
[ Values ( false , true ) ] bool async,
1412
1413
[ Values ( null , - 1 , 0 , 42 , 9000 ) ] int ? milliseconds)
1413
1414
{
@@ -1421,7 +1422,7 @@ public void Indexes_CreateOne_should_execute_a_CreateIndexesOperation(
1421
1422
var weights = new BsonDocument ( "y" , 1 ) ;
1422
1423
var storageEngine = new BsonDocument( "awesome" , true ) ;
1423
1424
var maxTime = milliseconds != null ? TimeSpan . FromMilliseconds ( milliseconds . Value ) : ( TimeSpan ? ) null ;
1424
- var createOneIndexOptions = new CreateOneIndexOptions { MaxTime = maxTime } ;
1425
+ var createOneIndexOptions = usingCreateOneIndexOptions ? new CreateOneIndexOptions { MaxTime = maxTime } : null ;
1425
1426
var options = new CreateIndexOptions < BsonDocument >
1426
1427
{
1427
1428
Background = true ,
@@ -1474,7 +1475,7 @@ public void Indexes_CreateOne_should_execute_a_CreateIndexesOperation(
1474
1475
1475
1476
var operation = call. Operation . Should ( ) . BeOfType < CreateIndexesOperation > ( ) . Subject ;
1476
1477
operation. CollectionNamespace . FullName . Should ( ) . Be ( "foo.bar" ) ;
1477
- operation. MaxTime . Should ( ) . Be ( createOneIndexOptions . MaxTime ) ;
1478
+ operation. MaxTime . Should ( ) . Be ( createOneIndexOptions ? . MaxTime ) ;
1478
1479
operation. Requests . Count ( ) . Should ( ) . Be ( 1 ) ;
1479
1480
operation. WriteConcern . Should ( ) . BeSameAs ( writeConcern ) ;
1480
1481
@@ -1506,6 +1507,7 @@ public void Indexes_CreateOne_should_execute_a_CreateIndexesOperation(
1506
1507
[ ParameterAttributeData ]
1507
1508
public void Indexes_CreateMany_should_execute_a_CreateIndexesOperation(
1508
1509
[ Values ( false , true ) ] bool usingSession,
1510
+ [ Values ( false , true ) ] bool usingCreateManyIndexesOptions ,
1509
1511
[ Values ( false , true ) ] bool async ,
1510
1512
[ Values ( null , - 1 , 0 , 42 , 9000 ) ] int ? milliseconds )
1511
1513
{
@@ -1521,7 +1523,7 @@ public void Indexes_CreateMany_should_execute_a_CreateIndexesOperation(
1521
1523
var weights = new BsonDocument( "y", 1 ) ;
1522
1524
var storageEngine = new BsonDocument( "awesome", true) ;
1523
1525
var maxTime = milliseconds != null ? TimeSpan. FromMilliseconds( milliseconds. Value) : ( TimeSpan? ) null ;
1524
- var createManyIndexesOptions = new CreateManyIndexesOptions { MaxTime = maxTime } ;
1526
+ var createManyIndexesOptions = usingCreateManyIndexesOptions ? new CreateManyIndexesOptions { MaxTime = maxTime } : null ;
1525
1527
1526
1528
var options = new CreateIndexOptions < BsonDocument >
1527
1529
{
@@ -1576,7 +1578,7 @@ public void Indexes_CreateMany_should_execute_a_CreateIndexesOperation(
1576
1578
1577
1579
var operation = call. Operation . Should ( ) . BeOfType < CreateIndexesOperation > ( ) . Subject ;
1578
1580
operation. CollectionNamespace . Should ( ) . Be ( subject . CollectionNamespace ) ;
1579
- operation. MaxTime . Should ( ) . Be ( createManyIndexesOptions . MaxTime ) ;
1581
+ operation. MaxTime . Should ( ) . Be ( createManyIndexesOptions ? . MaxTime ) ;
1580
1582
operation. Requests . Count ( ) . Should ( ) . Be ( 2 ) ;
1581
1583
operation. WriteConcern . Should ( ) . BeSameAs ( writeConcern ) ;
1582
1584
0 commit comments