public void InjectingAnArrayDependencySucceedsIfNoneWereRegistered() { IUnityContainer container = new UnityContainer(); CollectionSupportTestClassWithDependencyArrayProperty resolved = container.Resolve <CollectionSupportTestClassWithDependencyArrayProperty>(); Assert.AreEqual(0, resolved.Dependency.Length); }
public void InjectingAnArrayDependencySucceedsIfSomeWereRegistered() { IUnityContainer container = new UnityContainer(); container.RegisterType <CollectionSupportTestClass>("Element1", new ContainerControlledLifetimeManager()); container.RegisterType <CollectionSupportTestClass>("Element2", new ContainerControlledLifetimeManager()); container.RegisterType <CollectionSupportTestClass>("Element3", new ContainerControlledLifetimeManager()); CollectionSupportTestClassWithDependencyArrayProperty resolved = container.Resolve <CollectionSupportTestClassWithDependencyArrayProperty>(); Assert.AreEqual(3, resolved.Dependency.Length); }