public void SetSpanContext() { var automaticTracer = new AutomaticTracer(); automaticTracer.Register(Mock.Of <ICommonTracer>()); var distributedTracer = (IDistributedTracer)automaticTracer; var expectedSpanContext = new SpanContext(1, 2); distributedTracer.SetSpanContext(expectedSpanContext); distributedTracer.GetSpanContext().Should().BeEquivalentTo(expectedSpanContext); }
public void SetSamplingPriority() { var manualTracer = new Mock <ICommonTracer>(); var automaticTracer = new AutomaticTracer(); automaticTracer.Register(manualTracer.Object); ((IDistributedTracer)automaticTracer).SetSamplingPriority(SamplingPriorityValues.UserKeep); manualTracer.Verify(t => t.SetSamplingPriority(SamplingPriorityValues.UserKeep), Times.Once); }
public void GetSpanContext() { var automaticTracer = new AutomaticTracer(); automaticTracer.Register(Mock.Of <ICommonTracer>()); automaticTracer.GetDistributedTrace().Should().BeNull(); var expectedSpanContext = new SpanContext(1, 2, SamplingPriorityValues.UserKeep, "Service", "Origin"); automaticTracer.SetDistributedTrace(expectedSpanContext); var actualSpanContext = ((IDistributedTracer)automaticTracer).GetSpanContext(); actualSpanContext.Should().BeEquivalentTo(expectedSpanContext); }