Skip to content

Commit a325457

Browse files
committed
Add unit test
1 parent 1fe0e1d commit a325457

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tracer/test/Datadog.Trace.Tests/Configuration/TracerSettingsTests.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,6 +1065,22 @@ public void TraceId128BitLoggingEnabled(string value, bool expected)
10651065
settings.TraceId128BitLoggingEnabled.Should().Be(expected);
10661066
}
10671067

1068+
[Theory]
1069+
[PairwiseData]
1070+
public void IsRemoteConfigurationAvailable(bool? overrideValue, bool? isRunningInAas)
1071+
{
1072+
var source = CreateConfigurationSource(
1073+
(ConfigurationKeys.AzureAppService.AzureAppServicesContextKey, AsString(isRunningInAas)),
1074+
(ConfigurationKeys.Rcm.RemoteConfigurationEnabled, AsString(overrideValue)));
1075+
var settings = new TracerSettings(source);
1076+
1077+
// Default is "rcm is enabled" and "we're not in AAS"
1078+
var expected = (overrideValue ?? true) && !(isRunningInAas ?? false);
1079+
settings.IsRemoteConfigurationAvailable.Should().Be(expected);
1080+
1081+
static string AsString(bool? value) => value.HasValue ? (value.Value ? "1" : "0") : string.Empty;
1082+
}
1083+
10681084
[Fact]
10691085
public void RecordsTelemetryAboutTfm()
10701086
{

0 commit comments

Comments
 (0)