From: <and...@us...> - 2009-10-07 16:34:31
|
Revision: 265 http://structuremap.svn.sourceforge.net/structuremap/?rev=265&view=rev Author: andreas_ohlund Date: 2009-10-07 16:34:20 +0000 (Wed, 07 Oct 2009) Log Message: ----------- Fixed bug where static properties caused JITExceptions Modified Paths: -------------- trunk/Source/StructureMap/Graph/SetterPropertyCollection.cs trunk/Source/StructureMap.Testing/Pipeline/SmartInstanceTester.cs Modified: trunk/Source/StructureMap/Graph/SetterPropertyCollection.cs =================================================================== --- trunk/Source/StructureMap/Graph/SetterPropertyCollection.cs 2009-10-06 13:51:35 UTC (rev 264) +++ trunk/Source/StructureMap/Graph/SetterPropertyCollection.cs 2009-10-07 16:34:20 UTC (rev 265) @@ -18,8 +18,7 @@ _properties = new List<SetterProperty>(); _plugin = plugin; - - foreach (PropertyInfo property in plugin.PluggedType.GetProperties()) + foreach (PropertyInfo property in plugin.PluggedType.GetProperties(BindingFlags.Public | BindingFlags.Instance)) { if (property.CanWrite && property.GetSetMethod(false) != null) { Modified: trunk/Source/StructureMap.Testing/Pipeline/SmartInstanceTester.cs =================================================================== --- trunk/Source/StructureMap.Testing/Pipeline/SmartInstanceTester.cs 2009-10-06 13:51:35 UTC (rev 264) +++ trunk/Source/StructureMap.Testing/Pipeline/SmartInstanceTester.cs 2009-10-07 16:34:20 UTC (rev 265) @@ -98,6 +98,7 @@ }); } + [Test] public void specify_an_array_as_a_constructor() { @@ -134,6 +135,16 @@ { build<ColorRule>(i => i.WithCtorArg("color").EqualTo("Red")).Color.ShouldEqual("Red"); } + + [Test] + public void specifying_double_property_should_handle_locale() + { + var container = new Container(x => x.ForRequestedType<ClassWithDoubleProperty>() + .TheDefault.Is.OfConcreteType<ClassWithDoubleProperty>() + .WithProperty(o=>o.Double).EqualTo("4,5")); + + Assert.AreEqual(4.5, container.GetInstance<ClassWithDoubleProperty>().Double); + } } public class ClassWithWidgetArrayCtor @@ -151,6 +162,11 @@ } } + public class ClassWithDoubleProperty + { + public double Double { get; set; } + } + public class ClassWithWidgetArraySetter { public IWidget[] Widgets { get; set; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |