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