Пример #1
0
        public void GetContextAndOptions()
        {
            ISpan span = new NoopSpan(spanContext, spanOptions);

            Assert.Equal(spanContext, span.Context);
            Assert.Equal(spanOptions, span.Options);
        }
Пример #2
0
        public void PutAttributeCallsAddAttributesByDefault()
        {
            var mockSpan = new Mock <NoopSpan>(spanContext, spanOptions)
            {
                CallBase = true
            };
            NoopSpan        span = mockSpan.Object;
            IAttributeValue val  = AttributeValue <bool> .Create(true);

            span.PutAttribute("MyKey", val);
            span.End();
            mockSpan.Verify((s) => s.PutAttributes(It.Is <IDictionary <string, IAttributeValue> >((d) => d.ContainsKey("MyKey"))));
        }
Пример #3
0
        public void GetOptions_WhenNullOptions()
        {
            ISpan span = new NoopSpan(notSampledSpanContext, default(SpanOptions));

            Assert.Equal(SpanOptions.None, span.Options);
        }