Skip to content

Commit e9022c3

Browse files
committed
Add helper for creating mutablesettings in tests
1 parent 3c8c926 commit e9022c3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tracer/src/Datadog.Trace/Configuration/MutableSettings.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,6 +1087,13 @@ public static MutableSettings CreateWithoutDefaultSources(TracerSettings tracerS
10871087
new OverrideErrorLog(),
10881088
tracerSettings);
10891089

1090+
public static MutableSettings CreateForTesting(TracerSettings tracerSettings, Dictionary<string, object?> settings)
1091+
=> CreateInitialMutableSettings(
1092+
new DictionaryConfigurationSource(settings.ToDictionary(x => x.Key, x => x.Value?.ToString()!)),
1093+
new ConfigurationTelemetry(),
1094+
new OverrideErrorLog(),
1095+
tracerSettings);
1096+
10901097
private static ConfigurationBuilder.ClassConfigurationResultWithKey<IDictionary<string, string>> RemapOtelTags(
10911098
in ConfigurationBuilder.ClassConfigurationResultWithKey<IDictionary<string, string>> original)
10921099
{

0 commit comments

Comments
 (0)