diff --git a/src/Arcus.Observability.Tests.Integration/Serilog/Sinks/ApplicationInsights/ApplicationInsightsSinkExtensionTests.cs b/src/Arcus.Observability.Tests.Integration/Serilog/Sinks/ApplicationInsights/ApplicationInsightsSinkExtensionTests.cs index 1ddb3079..8c79150c 100644 --- a/src/Arcus.Observability.Tests.Integration/Serilog/Sinks/ApplicationInsights/ApplicationInsightsSinkExtensionTests.cs +++ b/src/Arcus.Observability.Tests.Integration/Serilog/Sinks/ApplicationInsights/ApplicationInsightsSinkExtensionTests.cs @@ -45,7 +45,7 @@ await RetryAssertUntilTelemetryShouldBeAvailableAsync(async client => EventsTraceResult[] traces = await client.GetTracesAsync(); AssertX.Any(traces, trace => { - Assert.Equal(message, trace.Message); + Assert.Equal(message, trace.Trace.Message); }); }); } @@ -74,7 +74,7 @@ await RetryAssertUntilTelemetryShouldBeAvailableAsync(async client => EventsTraceResult[] traces = await client.GetTracesAsync(); AssertX.Any(traces, trace => { - Assert.Equal(message, trace.Message); + Assert.Equal(message, trace.Trace.Message); }); }); } @@ -98,7 +98,7 @@ await RetryAssertUntilTelemetryShouldBeAvailableAsync(async client => EventsTraceResult[] traces = await client.GetTracesAsync(); AssertX.Any(traces, trace => { - Assert.Equal(message, trace.Message); + Assert.Equal(message, trace.Trace.Message); }); }); } @@ -125,7 +125,7 @@ await RetryAssertUntilTelemetryShouldBeAvailableAsync(async client => EventsTraceResult[] traces = await client.GetTracesAsync(); AssertX.Any(traces, trace => { - Assert.Equal(message, trace.Message); + Assert.Equal(message, trace.Trace.Message); }); }); } @@ -153,7 +153,7 @@ await RetryAssertUntilTelemetryShouldBeAvailableAsync(async client => EventsTraceResult[] result = await client.GetTracesAsync(); AssertX.Any(result, trace => { - Assert.Equal(message, trace.Message); + Assert.Equal(message, trace.Trace.Message); Assert.Equal(correlation.TransactionId, trace.Operation.Id); Assert.Equal(correlation.OperationId, trace.Operation.ParentId); }); @@ -183,7 +183,7 @@ await RetryAssertUntilTelemetryShouldBeAvailableAsync(async client => EventsTraceResult[] result = await client.GetTracesAsync(); AssertX.Any(result, trace => { - Assert.Equal(message, trace.Message); + Assert.Equal(message, trace.Trace.Message); Assert.Equal(correlation.TransactionId, trace.Operation.Id); Assert.Equal(correlation.OperationId, trace.Operation.ParentId); }); diff --git a/src/Arcus.Observability.Tests.Integration/Serilog/Sinks/ApplicationInsights/EventTests.cs b/src/Arcus.Observability.Tests.Integration/Serilog/Sinks/ApplicationInsights/EventTests.cs index 4a1db728..a623cc1a 100644 --- a/src/Arcus.Observability.Tests.Integration/Serilog/Sinks/ApplicationInsights/EventTests.cs +++ b/src/Arcus.Observability.Tests.Integration/Serilog/Sinks/ApplicationInsights/EventTests.cs @@ -57,7 +57,7 @@ await RetryAssertUntilTelemetryShouldBeAvailableAsync(async client => EventsTraceResult[] results = await client.GetTracesAsync(); AssertX.Any(results, trace => { - Assert.Equal(message, trace.Message); + Assert.Equal(message, trace.Trace.Message); Assert.Equal(componentName, trace.RoleName); }); }); @@ -109,7 +109,7 @@ await RetryAssertUntilTelemetryShouldBeAvailableAsync(async client => EventsTraceResult[] traceEvents = await client.GetTracesAsync(); AssertX.Any(traceEvents, trace => { - Assert.Equal(message, trace.Message); + Assert.Equal(message, trace.Trace.Message); Assert.Equal(operationId, Assert.Contains(ContextProperties.Correlation.OperationId, trace.CustomDimensions)); Assert.Equal(transactionId, Assert.Contains(ContextProperties.Correlation.TransactionId, trace.CustomDimensions)); Assert.Equal(operationParentId, Assert.Contains(ContextProperties.Correlation.OperationParentId, trace.CustomDimensions)); @@ -145,7 +145,7 @@ await RetryAssertUntilTelemetryShouldBeAvailableAsync(async client => EventsTraceResult[] traceEvents = await client.GetTracesAsync(); AssertX.Any(traceEvents, trace => { - Assert.Equal(message, trace.Message); + Assert.Equal(message, trace.Trace.Message); Assert.Equal(nodeName, Assert.Contains(ContextProperties.Kubernetes.NodeName, trace.CustomDimensions)); Assert.Equal(podName, Assert.Contains(ContextProperties.Kubernetes.PodName, trace.CustomDimensions)); Assert.Equal(@namespace, Assert.Contains(ContextProperties.Kubernetes.Namespace, trace.CustomDimensions)); diff --git a/src/Arcus.Observability.Tests.Integration/Serilog/Sinks/ApplicationInsights/Fixture/ITelemetryQueryClient.cs b/src/Arcus.Observability.Tests.Integration/Serilog/Sinks/ApplicationInsights/Fixture/ITelemetryQueryClient.cs index ce754aa6..b52416c1 100644 --- a/src/Arcus.Observability.Tests.Integration/Serilog/Sinks/ApplicationInsights/Fixture/ITelemetryQueryClient.cs +++ b/src/Arcus.Observability.Tests.Integration/Serilog/Sinks/ApplicationInsights/Fixture/ITelemetryQueryClient.cs @@ -64,16 +64,29 @@ public class EventsTraceResult { public EventsTraceResult(string message, string roleName, OperationResult operation, IDictionary customDimensions) { - Message = message; + Trace = new TraceResult(message); RoleName = roleName; Operation = operation; CustomDimensions = customDimensions; } - public string Message { get; } + public TraceResult Trace { get; } public string RoleName { get; } public OperationResult Operation { get; } public IDictionary CustomDimensions { get; } + + public class TraceResult + { + /// + /// Initializes a new instance of the class. + /// + public TraceResult(string message) + { + Message = message; + } + + public string Message { get; } + } } public class EventsCustomEventResult diff --git a/src/Arcus.Observability.Tests.Integration/Serilog/Sinks/ApplicationInsights/TraceTests.cs b/src/Arcus.Observability.Tests.Integration/Serilog/Sinks/ApplicationInsights/TraceTests.cs index 82d544ec..5e9fe948 100644 --- a/src/Arcus.Observability.Tests.Integration/Serilog/Sinks/ApplicationInsights/TraceTests.cs +++ b/src/Arcus.Observability.Tests.Integration/Serilog/Sinks/ApplicationInsights/TraceTests.cs @@ -28,7 +28,7 @@ await RetryAssertUntilTelemetryShouldBeAvailableAsync(async client => EventsTraceResult[] results = await client.GetTracesAsync(); AssertX.Any(results, result => { - Assert.Contains(message, result.Message); + Assert.Contains(message, result.Trace.Message); }); }); } @@ -52,7 +52,7 @@ await RetryAssertUntilTelemetryShouldBeAvailableAsync(async client => EventsTraceResult[] results = await client.GetTracesAsync(); AssertX.Any(results, result => { - Assert.Contains(message, result.Message); + Assert.Contains(message, result.Trace.Message); Assert.True(result.CustomDimensions.TryGetValue(key, out string actual), "Should contain custom dimension property"); Assert.Equal(expected, actual); }); @@ -78,7 +78,7 @@ await RetryAssertUntilTelemetryShouldBeAvailableAsync(async client => EventsTraceResult[] results = await client.GetTracesAsync(); AssertX.Any(results, result => { - Assert.Contains(message, result.Message); + Assert.Contains(message, result.Trace.Message); Assert.True(result.CustomDimensions.TryGetValue(key, out string actual), "Should contain custom dimension property"); Assert.Equal(expected, actual); }); @@ -104,7 +104,7 @@ await RetryAssertUntilTelemetryShouldBeAvailableAsync(async client => EventsTraceResult[] results = await client.GetTracesAsync(); AssertX.Any(results, result => { - Assert.Contains(message, result.Message); + Assert.Contains(message, result.Trace.Message); Assert.True(result.CustomDimensions.TryGetValue(key, out string actual), "Should contain custom dimension property"); Assert.Equal(expected, actual); });