diff --git a/product/roundhouse.tests/infrastructure.app/tokens/TokenReplacerSpecs.cs b/product/roundhouse.tests/infrastructure.app/tokens/TokenReplacerSpecs.cs index 6e57689d..172608ac 100644 --- a/product/roundhouse.tests/infrastructure.app/tokens/TokenReplacerSpecs.cs +++ b/product/roundhouse.tests/infrastructure.app/tokens/TokenReplacerSpecs.cs @@ -74,9 +74,9 @@ public void if_given_a_value_that_is_not_set_should_return_empty_string() } [Observation] - public void if_given_a_value_that_does_not_exist_should_return_the_value() + public void if_given_a_value_that_does_not_exist_should_return_the_value_with_original_casing() { - TokenReplacer.replace_tokens(configuration, "ALTER DATABASE {{database}}").should_be_equal_to("ALTER DATABASE {{database}}"); + TokenReplacer.replace_tokens(configuration, "ALTER DATABASE {{DataBase}}").should_be_equal_to("ALTER DATABASE {{DataBase}}"); } } } diff --git a/product/roundhouse/infrastructure.app/tokens/TokenReplacer.cs b/product/roundhouse/infrastructure.app/tokens/TokenReplacer.cs index 607e52c8..d4ffe708 100644 --- a/product/roundhouse/infrastructure.app/tokens/TokenReplacer.cs +++ b/product/roundhouse/infrastructure.app/tokens/TokenReplacer.cs @@ -18,7 +18,7 @@ public static string replace_tokens(ConfigurationPropertyHolder configuration, s { string key = ""; - key = m.Groups["key"].Value.to_lower(); + key = m.Groups["key"].Value; if (!dictionary.ContainsKey(key)) { return "{{" + key + "}}"; @@ -33,10 +33,10 @@ public static string replace_tokens(ConfigurationPropertyHolder configuration, s private static IDictionary create_dictionary_from_configuration(ConfigurationPropertyHolder configuration) { - Dictionary property_dictionary = new Dictionary(); + Dictionary property_dictionary = new Dictionary(StringComparer.OrdinalIgnoreCase); foreach (var property in configuration.GetType().GetProperties()) { - property_dictionary.Add(property.Name.to_lower(), property.GetValue(configuration, null).to_string()); + property_dictionary.Add(property.Name, property.GetValue(configuration, null).to_string()); } return property_dictionary;