changed ConfigureObject(target, name) to return original target if no definition is found

This commit is contained in:
eeichinger
2008-06-22 07:50:42 +00:00
parent fa1a9a235b
commit c6c9a938e2
2 changed files with 10 additions and 1 deletions

View File

@@ -2104,7 +2104,7 @@ namespace Spring.Objects.Factory.Support
return ConfigureObject(name, definition, new ObjectWrapper(target));
}
return null;
return target;
}
/// <summary>

View File

@@ -1337,6 +1337,15 @@ namespace Spring.Objects.Factory
Assert.AreEqual(1, lof.ObjectPostProcessorCount, errMsg);
}
[Test]
public void ConfigureObjectReturnsOriginalInstanceIfNoDefinitionFound()
{
IConfigurableObjectFactory of = new DefaultListableObjectFactory();
object testObject = new object();
object resultObject = of.ConfigureObject(testObject, "non-existing object definition name");
Assert.AreSame(testObject, resultObject);
}
#region Helper Classes
public class GoodDisposable : IDisposable