Skip to content

Commit

Permalink
https://github.com/chucknorris/roundhouse/pull/65
Browse files Browse the repository at this point in the history
  • Loading branch information
ferventcoder committed Sep 7, 2012
1 parent 4740243 commit d1f1f70
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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}}");
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions product/roundhouse/infrastructure.app/tokens/TokenReplacer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 + "}}";
Expand All @@ -33,10 +33,10 @@ public static string replace_tokens(ConfigurationPropertyHolder configuration, s

private static IDictionary<string, string> create_dictionary_from_configuration(ConfigurationPropertyHolder configuration)
{
Dictionary<string, string> property_dictionary = new Dictionary<string, string>();
Dictionary<string, string> property_dictionary = new Dictionary<string, string>(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;
Expand Down

0 comments on commit d1f1f70

Please sign in to comment.