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