Skip to content

Commit

Permalink
Add test for referenced property in dictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
ni-mi authored and nimrod-doubleverify committed Dec 4, 2020
1 parent 4001f60 commit bc09466
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions src/Castle.Windsor.Tests/Config/ConfigurationTestCase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,39 @@ public class ConfigurationTestCase : AbstractContainerTestCase



[Test]
[Bug("https://github.com/castleproject/Windsor/issues/574")]
public void DictionaryWithReferencedProperty()
{
var config =
@"
<configuration>
<properties>
<value1>Property Value 1</value1>
<value2>Property Value 2</value2>
</properties>
<components>
<component id='stringToStringDictionary' type='System.Collections.Generic.Dictionary`2[System.String, System.String]'>
<parameters>
<dictionary>
<dictionary>
<entry key='Key 1'>#{value1}</entry>
<entry key='Key 2'>#{value2}</entry>
</dictionary>
</dictionary>
</parameters>
</component>
</components>
</configuration>";

Container.Install(Configuration.FromXml(new StaticContentResource(config)));
var stringToStringDictionary = Container.Resolve<Dictionary<string, string>>("stringToStringDictionary");
Assert.NotNull(stringToStringDictionary);
Assert.AreEqual(2, stringToStringDictionary.Count);
Assert.AreEqual("Property Value 1", stringToStringDictionary["Key 1"]);
Assert.AreEqual("Property Value 2", stringToStringDictionary["Key 2"]);
}


[Test]
[Bug("https://github.com/castleproject/Windsor/issues/574")]
Expand Down

0 comments on commit bc09466

Please sign in to comment.