Skip to content

Commit

Permalink
more test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
reyang committed Mar 5, 2021
1 parent ecffe5d commit b41ca42
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/OpenTelemetry.Tests/Trace/ExceptionProcessorTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public void ActivityStatusSetToErrorWhenExceptionProcessorEnabled()
Activity activity2 = null;
Activity activity3 = null;
Activity activity4 = null;
Activity activity5 = null;

try
{
Expand All @@ -55,18 +56,28 @@ public void ActivityStatusSetToErrorWhenExceptionProcessorEnabled()
using (activity3 = activitySource.StartActivity("Activity3"))
{
}

activity5 = activitySource.StartActivity("Activity5");
}
finally
{
using (activity4 = activitySource.StartActivity("Activity4"))
{
}

activity5.Dispose();
}

Assert.Equal(StatusCode.Error, activity1.GetStatus().StatusCode);
Assert.Null(activity1.GetTagValue("otel.exception_pointers"));
Assert.Equal(StatusCode.Error, activity2.GetStatus().StatusCode);
Assert.Null(activity2.GetTagValue("otel.exception_pointers"));
Assert.Equal(StatusCode.Unset, activity3.GetStatus().StatusCode);
Assert.Null(activity3.GetTagValue("otel.exception_pointers"));
Assert.Equal(StatusCode.Unset, activity4.GetStatus().StatusCode);
Assert.Null(activity4.GetTagValue("otel.exception_pointers"));
Assert.Equal(StatusCode.Unset, activity5.GetStatus().StatusCode);
Assert.NotNull(activity5.GetTagValue("otel.exception_pointers"));
}

[Fact]
Expand Down

0 comments on commit b41ca42

Please sign in to comment.