Skip to content

Commit e6e6c9b

Browse files
committed
test(trace): add expected data to trace context
1 parent a04a10a commit e6e6c9b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/Sentry.Tests/Protocol/Context/TraceTests.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public void SerializeObject_AllPropertiesSetToNonDefault_SerializesValidObject()
3838
SpanId = SpanId.Parse("2000000000000000"),
3939
TraceId = SentryId.Parse("75302ac48a024bde9a3b3734a82e36c8")
4040
};
41+
trace.SetData("route", "home");
4142

4243
// Act
4344
var actual = trace.ToJsonString(_testOutputLogger, indented: true);
@@ -52,7 +53,10 @@ public void SerializeObject_AllPropertiesSetToNonDefault_SerializesValidObject()
5253
"trace_id": "75302ac48a024bde9a3b3734a82e36c8",
5354
"op": "op123",
5455
"origin": "auto.abc.def.ghi",
55-
"status": "aborted"
56+
"status": "aborted",
57+
"": {
58+
"route": "home"
59+
}
5660
}
5761
""",
5862
actual);
@@ -72,6 +76,7 @@ public void Clone_CopyValues()
7276
SpanId = SpanId.Parse("2000000000000000"),
7377
TraceId = SentryId.Parse("75302ac48a024bde9a3b3734a82e36c8")
7478
};
79+
trace.SetData("previous_route", "home");
7580

7681
// Act
7782
var clone = trace.Clone();
@@ -84,6 +89,7 @@ public void Clone_CopyValues()
8489
Assert.Equal(trace.ParentSpanId, clone.ParentSpanId);
8590
Assert.Equal(trace.SpanId, clone.SpanId);
8691
Assert.Equal(trace.TraceId, clone.TraceId);
92+
Assert.Equal(trace.Data, clone.Data);
8793
}
8894

8995
[Fact]

0 commit comments

Comments
 (0)