Пример #1
0
        public void AddUnamedComponent()
        {
            IComponent component = new Component();

            container.Add(component);
            ISite site = component.Site;

            Assert.IsNotNull(site);
            Assert.AreSame(container, site.Container);
            Assert.AreEqual(1, container.Components.Count);
            Assert.IsNotNull(site.GetService(typeof(IHandler)));

            IComponent component2 = container.Components[0];

            Assert.AreSame(component, component2);
            Assert.AreSame(container, component2.Site.Container);
        }