示例#1
0
            public void EvaluatesLateAddedSettingExpression()
            {
                // Given
                IConfiguration       configuration = new ConfigurationRoot(Array.Empty <IConfigurationProvider>());
                TestExecutionContext context       = new TestExecutionContext();

                context.ScriptHelper = new ScriptHelper(context);
                ConfigurationSettings configurationSettings = new ConfigurationSettings(context, configuration, null);

                // When
                configurationSettings.Add("Foo", @"=> $""ABC {1+2} XYZ""");

                // Then
                configurationSettings.TryGetValue("foo", out object value).ShouldBeTrue();
                value.ShouldBe("ABC 3 XYZ");
            }