|
13 | 13 | using Datadog.Trace.Agent.DiscoveryService; |
14 | 14 | using Datadog.Trace.Configuration; |
15 | 15 | using Datadog.Trace.ExtensionMethods; |
| 16 | +using Datadog.Trace.Tests.Util; |
16 | 17 | using FluentAssertions; |
17 | 18 | using Moq; |
18 | 19 | using Xunit; |
@@ -201,15 +202,15 @@ public async Task CollectsMeasuredSpans_TS004() |
201 | 202 | parentSpan.SetDuration(TimeSpan.FromMilliseconds(100)); |
202 | 203 |
|
203 | 204 | // childSpan shouldn't be recorded, because it's not top-level and doesn't have the Measured tag |
204 | | - var childSpan = new Span(new SpanContext(parentSpan.Context, new TraceContext(Mock.Of<IDatadogTracer>()), "service"), start); |
| 205 | + var childSpan = new Span(new SpanContext(parentSpan.Context, new TraceContext(new StubDatadogTracer()), "service"), start); |
205 | 206 | childSpan.SetDuration(TimeSpan.FromMilliseconds(100)); |
206 | 207 |
|
207 | | - var measuredChildSpan1 = new Span(new SpanContext(parentSpan.Context, new TraceContext(Mock.Of<IDatadogTracer>()), "service"), start); |
| 208 | + var measuredChildSpan1 = new Span(new SpanContext(parentSpan.Context, new TraceContext(new StubDatadogTracer()), "service"), start); |
208 | 209 | measuredChildSpan1.OperationName = "child.op1"; |
209 | 210 | measuredChildSpan1.SetTag(Tags.Measured, "1"); |
210 | 211 | measuredChildSpan1.SetDuration(TimeSpan.FromMilliseconds(100)); |
211 | 212 |
|
212 | | - var measuredChildSpan2 = new Span(new SpanContext(parentSpan.Context, new TraceContext(Mock.Of<IDatadogTracer>()), "service"), start); |
| 213 | + var measuredChildSpan2 = new Span(new SpanContext(parentSpan.Context, new TraceContext(new StubDatadogTracer()), "service"), start); |
213 | 214 | measuredChildSpan2.OperationName = "child.op2"; |
214 | 215 | measuredChildSpan2.SetTag(Tags.Measured, "1"); |
215 | 216 | measuredChildSpan2.SetDuration(TimeSpan.FromMilliseconds(100)); |
@@ -271,7 +272,7 @@ public async Task CollectsTopLevelSpans_TS005() |
271 | 272 | snapshotSpan.SetDuration(TimeSpan.FromMilliseconds(300)); |
272 | 273 |
|
273 | 274 | // Create a new child span that is a service entry span, which means it will have stats computed for it |
274 | | - var httpClientServiceSpan = new Span(new SpanContext(parentSpan.Context, new TraceContext(Mock.Of<IDatadogTracer>()), "service-http-client"), start); |
| 275 | + var httpClientServiceSpan = new Span(new SpanContext(parentSpan.Context, new TraceContext(new StubDatadogTracer()), "service-http-client"), start); |
275 | 276 | httpClientServiceSpan.SetDuration(TimeSpan.FromMilliseconds(400)); |
276 | 277 |
|
277 | 278 | aggregator.Add(simpleSpan, parentSpan, snapshotSpan, httpClientServiceSpan); |
|
0 commit comments