コード例 #1
0
        public void CreateNewSpan()
        {
            var spanName     = fixture.Create <string>();
            var traceId      = Guid.NewGuid().ToString("N");
            var parentSpanId = fixture.Create <long>().ToString("x");
            var spanId       = fixture.Create <long>().ToString("x");

            var resultSpan = SpanTracer.CreateNewSpan(spanName, traceId, parentSpanId, spanId);

            Assert.AreEqual(spanName, resultSpan.Name);
            Assert.AreEqual(traceId, resultSpan.TraceId);
            Assert.AreEqual(parentSpanId, resultSpan.ParentId);
            Assert.AreEqual(spanId, resultSpan.Id);
        }
コード例 #2
0
        public void CreateNewSpan_WithNullParentSpanId()
        {
            var resultSpan = SpanTracer.CreateNewSpan(fixture.Create <string>(), fixture.Create <long>().ToString(), null, fixture.Create <long>().ToString());

            Assert.IsNull(resultSpan.ParentId);
        }