44// </copyright>
55
66using Datadog . Trace . Sampling ;
7+ using Datadog . Trace . Tests . Util ;
78using FluentAssertions ;
89using Moq ;
910using Xunit ;
@@ -20,8 +21,8 @@ public class TraceContextTests_SetSamplingDecision
2021 [ InlineData ( SamplingPriorityValues . UserKeep , SamplingMechanism . Asm ) ]
2122 public void SetSamplingDecision ( int samplingPriority , string samplingMechanism )
2223 {
23- var tracer = new Mock < IDatadogTracer > ( ) ;
24- var traceContext = new TraceContext ( tracer . Object ) ;
24+ var tracer = new StubDatadogTracer ( ) ;
25+ var traceContext = new TraceContext ( tracer ) ;
2526 traceContext . SetSamplingPriority ( samplingPriority , samplingMechanism ) ;
2627
2728 traceContext . SamplingPriority . Should ( ) . Be ( samplingPriority ) ;
@@ -39,8 +40,8 @@ public void SetSamplingDecision(int samplingPriority, string samplingMechanism)
3940 [ Fact ]
4041 public void SetSamplingDecision_KeepsFirstMechanism ( )
4142 {
42- var tracer = new Mock < IDatadogTracer > ( ) ;
43- var traceContext = new TraceContext ( tracer . Object ) ;
43+ var tracer = new StubDatadogTracer ( ) ;
44+ var traceContext = new TraceContext ( tracer ) ;
4445
4546 traceContext . SetSamplingPriority ( SamplingPriorityValues . AutoKeep , SamplingMechanism . AgentRate ) ;
4647 traceContext . SamplingPriority . Should ( ) . Be ( SamplingPriorityValues . AutoKeep ) ;
@@ -54,8 +55,8 @@ public void SetSamplingDecision_KeepsFirstMechanism()
5455 [ Fact ]
5556 public void SetSamplingDecision_RemovesMechanismOnDrop ( )
5657 {
57- var tracer = new Mock < IDatadogTracer > ( ) ;
58- var traceContext = new TraceContext ( tracer . Object ) ;
58+ var tracer = new StubDatadogTracer ( ) ;
59+ var traceContext = new TraceContext ( tracer ) ;
5960
6061 traceContext . SetSamplingPriority ( SamplingPriorityValues . AutoKeep , SamplingMechanism . AgentRate ) ;
6162 traceContext . SamplingPriority . Should ( ) . Be ( SamplingPriorityValues . AutoKeep ) ;
0 commit comments