public void SimpleContainment() { ContainerComponent cc = new ContainerComponent(); cc.Add(new Component()); SimpleComponent sc = new SimpleComponent(); cc.Add(sc); Assert.IsTrue(sc.sited); }
public void ServiceContainment() { ServiceContainer parent = new ServiceContainer(); parent.AddService(typeof(ContainerComponentTests), this); ContainerComponent child = new ContainerComponent(); SimpleComponent sc = new SimpleComponent(); child.Add(sc); Assert.IsNull(((IServiceProvider)child).GetService( typeof(ContainerComponentTests))); parent.Add(child); Assert.AreSame(this, ((IServiceProvider)parent).GetService( typeof(ContainerComponentTests))); }