public void GetContextAndOptions() { ISpan span = new NoopSpan(spanContext, spanOptions); Assert.Equal(spanContext, span.Context); Assert.Equal(spanOptions, span.Options); }
public void PutAttributeCallsAddAttributesByDefault() { var mockSpan = new Mock <NoopSpan>(spanContext, spanOptions) { CallBase = true }; NoopSpan span = mockSpan.Object; IAttributeValue val = AttributeValue <bool> .Create(true); span.SetAttribute("MyKey", val); span.End(); mockSpan.Verify((s) => s.SetAttributes(It.Is <IDictionary <string, IAttributeValue> >((d) => d.ContainsKey("MyKey")))); }
public void GetOptions_WhenNullOptions() { ISpan span = new NoopSpan(notSampledSpanContext, default(SpanOptions)); Assert.Equal(SpanOptions.None, span.Options); }