diff --git a/test/Datadog.Trace.TestHelpers/MockTracerAgent.cs b/test/Datadog.Trace.TestHelpers/MockTracerAgent.cs index b1cccb09c32a..73db003315bf 100644 --- a/test/Datadog.Trace.TestHelpers/MockTracerAgent.cs +++ b/test/Datadog.Trace.TestHelpers/MockTracerAgent.cs @@ -56,6 +56,8 @@ public MockTracerAgent(int port = 8126, int retries = 5) public event EventHandler> RequestReceived; + public event EventHandler>>> RequestDeserialized; + /// /// Gets or sets a value indicating whether to skip serialization of traces. /// @@ -148,6 +150,11 @@ protected virtual void OnRequestReceived(HttpListenerContext context) RequestReceived?.Invoke(this, new EventArgs(context)); } + protected virtual void OnRequestDeserialized(IList> traces) + { + RequestDeserialized?.Invoke(this, new EventArgs>>(traces)); + } + private void AssertHeader( NameValueCollection headers, string headerKey, @@ -178,6 +185,7 @@ private void HandleHttpRequests() if (ShouldDeserializeTraces) { var spans = MessagePackSerializer.Deserialize>>(ctx.Request.InputStream); + OnRequestDeserialized(spans); lock (this) {