Skip to content

Commit

Permalink
Renamed variables
Browse files Browse the repository at this point in the history
  • Loading branch information
ngruson committed Dec 4, 2023
1 parent b1c9676 commit baf5d09
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions test/OpenTelemetry.Shims.OpenTracing.Tests/TracerShimTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ public void Inject_ArgumentValidation()
var shim = new TracerShim(TracerProvider.Default, new TraceContextPropagator());

var spanContextShim = new SpanContextShim(new SpanContext(ActivityTraceId.CreateRandom(), ActivitySpanId.CreateRandom(), ActivityTraceFlags.None));
var mockFormat = new TestFormatTextMap();
var mockCarrier = new TestTextMap();
var testFormat = new TestFormatTextMap();
var testCarrier = new TestTextMap();

Assert.Throws<ArgumentNullException>(() => shim.Inject(null, mockFormat, mockCarrier));
Assert.Throws<InvalidCastException>(() => shim.Inject(new TestSpanContext(), mockFormat, mockCarrier));
Assert.Throws<ArgumentNullException>(() => shim.Inject(spanContextShim, null, mockCarrier));
Assert.Throws<ArgumentNullException>(() => shim.Inject(spanContextShim, mockFormat, null));
Assert.Throws<ArgumentNullException>(() => shim.Inject(null, testFormat, testCarrier));
Assert.Throws<InvalidCastException>(() => shim.Inject(new TestSpanContext(), testFormat, testCarrier));
Assert.Throws<ArgumentNullException>(() => shim.Inject(spanContextShim, null, testCarrier));
Assert.Throws<ArgumentNullException>(() => shim.Inject(spanContextShim, testFormat, null));
}

[Fact]
Expand Down Expand Up @@ -97,12 +97,11 @@ public void Extract_ArgumentValidation()
public void Extract_UnknownFormatIgnored()
{
var shim = new TracerShim(TracerProvider.Default, new TraceContextPropagator());

var spanContextShim = new SpanContextShim(new SpanContext(ActivityTraceId.CreateRandom(), ActivitySpanId.CreateRandom(), ActivityTraceFlags.None));
_ = new SpanContextShim(new SpanContext(ActivityTraceId.CreateRandom(), ActivitySpanId.CreateRandom(), ActivityTraceFlags.None));

// Only two specific types of ITextMap are supported, and neither is a Mock.
var mockCarrier = new TestTextMap();
var context = shim.Extract(new TestFormatTextMap(), mockCarrier);
_ = shim.Extract(new TestFormatTextMap(), mockCarrier);

// Verify that the carrier mock was never called.
Assert.False(mockCarrier.SetCalled);
Expand Down

0 comments on commit baf5d09

Please sign in to comment.