@@ -231,7 +231,7 @@ public void SerializeObject_AllPropertiesSetToNonDefault_SerializesValidObject()
231
231
232
232
// Act
233
233
var finalTransaction = new SentryTransaction ( transaction ) ;
234
- var actualString = finalTransaction . ToJsonString ( _testOutputLogger ) ;
234
+ var actualString = finalTransaction . ToJsonString ( _testOutputLogger , indented : true ) ;
235
235
var actual = Json . Parse ( actualString , SentryTransaction . FromJson ) ;
236
236
237
237
// Assert
@@ -245,14 +245,29 @@ public void SerializeObject_AllPropertiesSetToNonDefault_SerializesValidObject()
245
245
return o ;
246
246
} ) ;
247
247
248
- using ( _ = new AssertionScope ( ) )
249
- {
250
- KeyValuePair < string , string > expectedData = new ( "extra_key" , "extra_value" ) ;
251
- finalTransaction . Data . Should ( ) . ContainSingle ( ) . Which . Should ( ) . Be ( expectedData ) ;
252
- finalTransaction . Contexts . Trace . Data . Should ( ) . ContainSingle ( ) . Which . Should ( ) . Be ( expectedData ) ;
253
- actual . Data . Should ( ) . ContainSingle ( ) . Which . Should ( ) . Be ( expectedData ) ;
254
- actual . Contexts . Trace . Data . Should ( ) . ContainSingle ( ) . Which . Should ( ) . Be ( expectedData ) ;
255
- }
248
+ Assert . Contains ( $$ """
249
+ "contexts": {
250
+ ".NET Framework": {
251
+ ".NET Framework": "\u0022v2.0.50727\u0022, \u0022v3.0\u0022, \u0022v3.5\u0022",
252
+ ".NET Framework Client": "\u0022v4.8\u0022, \u0022v4.0.0.0\u0022",
253
+ ".NET Framework Full": "\u0022v4.8\u0022"
254
+ },
255
+ "context_key": "context_value",
256
+ "trace": {
257
+ "type": "trace",
258
+ "span_id": "{{ context . SpanId }} ",
259
+ "parent_span_id": "{{ context . ParentSpanId }} ",
260
+ "trace_id": "{{ context . TraceId }} ",
261
+ "op": "op123",
262
+ "origin": "auto.serialize.transaction",
263
+ "description": "desc123",
264
+ "status": "aborted",
265
+ "data": {
266
+ "extra_key": "extra_value"
267
+ }
268
+ }
269
+ }
270
+ """ , actualString ) ;
256
271
}
257
272
258
273
[ Fact ]
0 commit comments