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