@@ -38,8 +38,6 @@ public void constructor_should_initialize_subject()
38
38
subject . CollectionNamespace . Should ( ) . BeSameAs ( _collectionNamespace ) ;
39
39
subject . Requests . Should ( ) . Equal ( requests ) ;
40
40
subject . MessageEncoderSettings . Should ( ) . BeSameAs ( _messageEncoderSettings ) ;
41
-
42
- subject . WriteConcern . Should ( ) . BeSameAs ( WriteConcern . Acknowledged ) ;
43
41
}
44
42
45
43
[ Fact ]
@@ -75,10 +73,7 @@ public void CreateOperation_should_return_expected_result()
75
73
var request = new CreateIndexRequest ( new BsonDocument ( "x" , 1 ) ) ;
76
74
var requests = new [ ] { request } ;
77
75
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 ) ;
82
77
83
78
var result = subject . CreateOperation ( null , request ) ;
84
79
@@ -91,7 +86,6 @@ public void CreateOperation_should_return_expected_result()
91
86
result . MaxMessageSize . Should ( ) . NotHaveValue ( ) ;
92
87
result . MessageEncoderSettings . Should ( ) . BeSameAs ( _messageEncoderSettings ) ;
93
88
result . Serializer . Should ( ) . BeSameAs ( BsonDocumentSerializer . Instance ) ;
94
- result . WriteConcern . Should ( ) . BeSameAs ( writeConcern ) ;
95
89
}
96
90
97
91
[ SkippableTheory ]
@@ -205,51 +199,6 @@ public void Execute_should_work_when_unique_is_true(
205
199
index [ "unique" ] . ToBoolean ( ) . Should ( ) . BeTrue ( ) ;
206
200
}
207
201
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
-
253
202
private List < BsonDocument > ListIndexes ( )
254
203
{
255
204
var listIndexesOperation = new ListIndexesOperation ( _collectionNamespace , _messageEncoderSettings ) ;
0 commit comments