public void ChildContainerResolvesInParent() { var container = new UnityContainer(); container.StandardConfiguration(); container.LoadConfiguration(); container.ConfigureRegistrars(); var expected = container.ConfigureChildContainer("test"); var candidate = container.Resolve<IUnityContainer>("test"); Assert.AreSame(expected, candidate); }
public void ChildResolveChildServiceDirectly() { var container = new UnityContainer(); container.StandardConfiguration(); container.LoadConfiguration(); container.ConfigureRegistrars(); var child = container.ConfigureChildContainer("test"); var expected = typeof(ChildTestClass); var candidate = child.Resolve<ITest>("direct2"); Assert.AreSame(expected, candidate.GetType()); }
public void FactoryCallInChild() { var container = new UnityContainer(); container.StandardConfiguration(); container.LoadConfiguration(); container.ConfigureRegistrars(); var child = container.ConfigureChildContainer("test"); var factory = child.Resolve<ITestFactory>(); var expected = typeof(ChildTestClass); var candidate = factory.Get(); Assert.AreSame(expected, candidate.GetType()); }