@@ -38,8 +38,6 @@ public void constructor_should_initialize_subject()
3838 subject . CollectionNamespace . Should ( ) . BeSameAs ( _collectionNamespace ) ;
3939 subject . Requests . Should ( ) . Equal ( requests ) ;
4040 subject . MessageEncoderSettings . Should ( ) . BeSameAs ( _messageEncoderSettings ) ;
41-
42- subject . WriteConcern . Should ( ) . BeSameAs ( WriteConcern . Acknowledged ) ;
4341 }
4442
4543 [ Fact ]
@@ -75,10 +73,7 @@ public void CreateOperation_should_return_expected_result()
7573 var request = new CreateIndexRequest ( new BsonDocument ( "x" , 1 ) ) ;
7674 var requests = new [ ] { request } ;
7775 var writeConcern = new WriteConcern ( 1 ) ;
78- var subject = new CreateIndexesUsingInsertOperation ( _collectionNamespace , requests , _messageEncoderSettings )
79- {
80- WriteConcern = writeConcern
81- } ;
76+ var subject = new CreateIndexesUsingInsertOperation ( _collectionNamespace , requests , _messageEncoderSettings ) ;
8277
8378 var result = subject . CreateOperation ( null , request ) ;
8479
@@ -91,7 +86,6 @@ public void CreateOperation_should_return_expected_result()
9186 result . MaxMessageSize . Should ( ) . NotHaveValue ( ) ;
9287 result . MessageEncoderSettings . Should ( ) . BeSameAs ( _messageEncoderSettings ) ;
9388 result . Serializer . Should ( ) . BeSameAs ( BsonDocumentSerializer . Instance ) ;
94- result . WriteConcern . Should ( ) . BeSameAs ( writeConcern ) ;
9589 }
9690
9791 [ SkippableTheory ]
@@ -205,51 +199,6 @@ public void Execute_should_work_when_unique_is_true(
205199 index [ "unique" ] . ToBoolean ( ) . Should ( ) . BeTrue ( ) ;
206200 }
207201
208- [ SkippableTheory ]
209- [ ParameterAttributeData ]
210- public void Execute_should_throw_when_a_write_concern_error_occurs (
211- [ Values ( false , true ) ]
212- bool async )
213- {
214- RequireServer . Check ( ) . Supports ( Feature . CreateIndexesCommand , Feature . CommandsThatWriteAcceptWriteConcern ) . ClusterType ( ClusterType . ReplicaSet ) ;
215- DropCollection ( ) ;
216- var requests = new [ ] { new CreateIndexRequest ( new BsonDocument ( "x" , 1 ) ) } ;
217- var subject = new CreateIndexesUsingInsertOperation ( _collectionNamespace , requests , _messageEncoderSettings )
218- {
219- WriteConcern = new WriteConcern ( 9 )
220- } ;
221-
222- var exception = Record . Exception ( ( ) => ExecuteOperation ( subject , async ) ) ;
223-
224- exception. Should( ) . BeOfType< MongoWriteConcernException> ( ) ;
225- }
226-
227- [ Theory ]
228- [ ParameterAttributeData ]
229- public void WriteConcern_get_and_set_should_work(
230- [ Values ( 1 , 2 ) ]
231- int w )
232- {
233- var subject = new CreateIndexesUsingInsertOperation ( _collectionNamespace , Enumerable . Empty < CreateIndexRequest > ( ) , _messageEncoderSettings ) ;
234- var value = new WriteConcern ( w ) ;
235-
236- subject . WriteConcern = value ;
237- var result = subject . WriteConcern ;
238-
239- result . Should ( ) . BeSameAs ( value ) ;
240- }
241-
242- [ Fact ]
243- public void WriteConcern_set_should_throw_when_value_is_null( )
244- {
245- var subject = new CreateIndexesUsingInsertOperation( _collectionNamespace , Enumerable . Empty < CreateIndexRequest > ( ) , _messageEncoderSettings ) ;
246-
247- var exception = Record . Exception ( ( ) => { subject . WriteConcern = null ; } ) ;
248-
249- var argumentNullException = exception . Should ( ) . BeOfType < ArgumentNullException > ( ) . Subject ;
250- argumentNullException . ParamName . Should ( ) . Be ( "value" ) ;
251- }
252-
253202 private List < BsonDocument > ListIndexes ( )
254203 {
255204 var listIndexesOperation = new ListIndexesOperation ( _collectionNamespace , _messageEncoderSettings ) ;
0 commit comments