The support for unbounded number of method elements under the register node seems to have been removed. Now only the first method call is made. The schema for InjectionGroup defines "method" to be: minOccurs="0" maxOccurs="unbounded".
I'm not sure where it got lost but we are upgrading from old 4 to latest.
To Reproduce
public interface IChild
{
int Age { get; set; }
}
public interface IParent
{
IList<IChild> Children { get; set; }
void Add(IChild child);
}
public class Child : IChild
{
public int Age { get; set; }
public Child(int age)
{
Age = age;
}
}
public class Parent : IParent
{
public IList<IChild> Children { get; set; }
public Parent()
{
Children = new List<IChild>();
}
public void Add(IChild child)
{
Children.Add(child);
}
}
[TestClass]
public class Test
{
[TestMethod]
public void ResolveInstanceWithMultipleMethodCallsTest()
{
// Arrange
var container = new UnityContainer();
container.LoadConfiguration();
// Act
var parent = container.Resolve<IParent>();
// Assert
Assert.AreEqual(2, parent.Children.Count);
}
}
Description
The support for unbounded number of method elements under the register node seems to have been removed. Now only the first method call is made. The schema for InjectionGroup defines "method" to be: minOccurs="0" maxOccurs="unbounded".
I'm not sure where it got lost but we are upgrading from old 4 to latest.
To Reproduce
Additional context
The above test used this configuration: