public void JaegerHTTPTransport_BuildJaegerReference_ShouldReturnNullIfNoJaegerReferenceTypeMatches()
        {
            var refType = "sibling";
            var context = Substitute.For <ILetsTraceSpanContext>();
            var traceId = new TraceId {
                Low = 98246, High = 477924576
            };
            var spanId = new SpanId(846);

            context.TraceId.Returns(traceId);
            context.SpanId.Returns(spanId);

            var reference = new Reference(refType, context);

            var converted = JaegerThriftTransport.BuildJaegerReference(reference);

            Assert.Null(converted);
        }
        public void JaegerHTTPTransport_BuildJaegerReference_BuildsFollowsFromCorrectly()
        {
            var refType = References.FollowsFrom;
            var context = Substitute.For <ILetsTraceSpanContext>();
            var traceId = new TraceId {
                Low = 98246, High = 477924576
            };
            var spanId = new SpanId(846);

            context.TraceId.Returns(traceId);
            context.SpanId.Returns(spanId);

            var reference = new Reference(refType, context);

            var converted = JaegerThriftTransport.BuildJaegerReference(reference);

            Assert.Equal(JaegerReferenceType.FOLLOWS_FROM, converted.RefType);
            Assert.Equal((long)traceId.Low, converted.TraceIdLow);
            Assert.Equal((long)traceId.High, converted.TraceIdHigh);
            Assert.Equal(spanId, converted.SpanId);
        }
        public void JaegerHTTPTransport_BuildJaegerReference_BuildsChildOfCorrectly()
        {
            var refType = References.ChildOf;
            var context = Substitute.For <ILetsTraceSpanContext>();
            var traceId = new TraceId {
                Low = 152387, High = 4587234
            };
            var spanId = new SpanId(3087);

            context.TraceId.Returns(traceId);
            context.SpanId.Returns(spanId);

            var reference = new Reference(refType, context);

            var converted = JaegerThriftTransport.BuildJaegerReference(reference);

            Assert.Equal(JaegerReferenceType.CHILD_OF, converted.RefType);
            Assert.Equal((long)traceId.Low, converted.TraceIdLow);
            Assert.Equal((long)traceId.High, converted.TraceIdHigh);
            Assert.Equal(spanId, converted.SpanId);
        }