15
15
16
16
using System ;
17
17
using System . Collections . Generic ;
18
+ #if ! NETCOREAPP1_1
18
19
using System . IO ;
20
+ #endif
19
21
using System . Net ;
20
22
#if NET452
21
23
using System . Runtime . Serialization . Formatters . Binary ;
22
24
#endif
23
25
using FluentAssertions ;
24
26
using MongoDB . Bson ;
27
+ #if ! NETCOREAPP1_1
25
28
using MongoDB . Bson . TestHelpers . EqualityComparers ;
29
+ #endif
26
30
using MongoDB . Driver . Core . Clusters ;
27
31
using MongoDB . Driver . Core . Connections ;
28
32
using MongoDB . Driver . Core . Servers ;
@@ -64,7 +68,7 @@ public void constructor_should_initialize_subject()
64
68
subject . ConnectionId . Should ( ) . Be ( __connectionId ) ;
65
69
subject . ErrorLabels . Should ( ) . BeEquivalentTo ( __writeConcernError . ErrorLabels ) ;
66
70
subject . InnerException . Should ( ) . Be ( __innerException ) ;
67
- subject . Message . Should ( ) . Be ( "A write operation resulted in an error." + Environment . NewLine + " writeError" + Environment . NewLine + " writeConcernError") ;
71
+ subject . Message . Should ( ) . Be ( "A write operation resulted in an error. WriteError: { Category : \" Uncategorized \" , Code : 1, Message : \" writeError \" , Details : \" { \" details \" : \" writeError\" } \" }. WriteConcernError: { Code : \" 1 \" , Message : \" writeConcernError\" , Details : \" { \" details \" : \" writeConcernError \" } \" , ErrorLabels : [ \" RetryableWriteError \" ] }. " ) ;
68
72
subject . WriteConcernError . Should ( ) . Be ( __writeConcernError ) ;
69
73
subject . WriteError . Should ( ) . Be ( __writeError ) ;
70
74
}
@@ -85,7 +89,7 @@ public void FromBulkWriteException_should_return_expected_result()
85
89
result . ConnectionId . Should ( ) . Be ( __connectionId ) ;
86
90
result . ErrorLabels . Should ( ) . BeEquivalentTo ( writeConcernError . ErrorLabels ) ;
87
91
result . InnerException . Should ( ) . BeSameAs ( bulkWriteException ) ;
88
- result . Message . Should ( ) . Be ( "A write operation resulted in an error." + Environment . NewLine + " message" + Environment . NewLine + " message") ;
92
+ result . Message . Should ( ) . Be ( "A write operation resulted in an error. WriteError: { Category : \" Uncategorized \" , Code : 2, Message : \" message\" , Details : \" { \" details \" : 1 } \" }. WriteConcernError: { Code : \" 1 \" , Message : \" message\" , Details : \" { \" details \" : 1 } \" , ErrorLabels : [ \" RetryableWriteError \" ] }. " ) ;
89
93
result . WriteConcernError . Should ( ) . Be ( writeConcernError ) ;
90
94
result . WriteError . Should ( ) . Be ( writeErrors [ 0 ] ) ;
91
95
}
0 commit comments