public void NoopSpanBuilder_BadArguments() { Assert.Throws <ArgumentNullException>(() => new NoopSpanBuilder(null)); var spanBuilder = new NoopSpanBuilder("foo"); Assert.Throws <ArgumentNullException>(() => spanBuilder.SetParent((ISpan)null)); Assert.Throws <ArgumentNullException>(() => spanBuilder.SetParent((SpanContext)null)); Assert.Throws <ArgumentNullException>(() => spanBuilder.SetParent((Activity)null)); // no Activity.Current Assert.Throws <ArgumentException>(() => spanBuilder.SetCreateChild(false)); // Activity.Current wrong format var a = new Activity("foo") .SetIdFormat(ActivityIdFormat.Hierarchical) .Start(); Assert.Throws <ArgumentException>(() => spanBuilder.SetCreateChild(false)); a.Stop(); Assert.Throws <ArgumentNullException>(() => spanBuilder.SetSampler(null)); Assert.Throws <ArgumentNullException>(() => spanBuilder.AddLink((Link)null)); Assert.Throws <ArgumentNullException>(() => spanBuilder.AddLink((SpanContext)null)); Assert.Throws <ArgumentNullException>(() => spanBuilder.AddLink(null, null)); Assert.Throws <ArgumentException>(() => spanBuilder.AddLink(SpanContext.Blank)); Assert.Throws <ArgumentException>(() => spanBuilder.AddLink(SpanContext.Blank, null)); Assert.Throws <ArgumentException>(() => spanBuilder.AddLink(SpanContext.Blank, null)); }
public void NoopSpanBuilder_BadArguments() { Assert.Throws <ArgumentNullException>(() => new NoopSpanBuilder(null)); var spanBuilder = new NoopSpanBuilder("foo"); Assert.Throws <ArgumentNullException>(() => spanBuilder.SetParent((ISpan)null)); Assert.Throws <ArgumentNullException>(() => spanBuilder.SetParent((SpanContext)null)); Assert.Throws <ArgumentNullException>(() => spanBuilder.SetSampler(null)); Assert.Throws <ArgumentNullException>(() => spanBuilder.AddLink((ILink)null)); Assert.Throws <ArgumentNullException>(() => spanBuilder.AddLink((SpanContext)null)); Assert.Throws <ArgumentNullException>(() => spanBuilder.AddLink(null, null)); Assert.Throws <ArgumentNullException>(() => spanBuilder.AddLink(SpanContext.Blank, null)); }
public override ISpanBuilder SpanBuilderWithRemoteParent(string spanName, ISpanContext remoteParentSpanContext) { return(NoopSpanBuilder.CreateWithRemoteParent(spanName, remoteParentSpanContext)); }
public override ISpanBuilder SpanBuilderWithExplicitParent(string spanName, ISpan parent) { return(NoopSpanBuilder.CreateWithParent(spanName, parent)); }
/// <inheritdoc/> public override ISpanBuilder SpanBuilderWithRemoteParent(string spanName, SpanKind spanKind = SpanKind.Internal, ISpanContext remoteParentSpanContext = null) { return(NoopSpanBuilder.CreateWithRemoteParent(spanName, spanKind, remoteParentSpanContext)); }
/// <inheritdoc/> public override ISpanBuilder SpanBuilderWithExplicitParent(string spanName, SpanKind spanKind = SpanKind.Internal, ISpan parent = null) { return(NoopSpanBuilder.CreateWithParent(spanName, spanKind, parent)); }