Exemplo n.º 1
0
        public void Components_GetWithCustomFilterServiceAfterChangingComponents_ReturnsUpdatedComponents()
        {
            var component1 = new SubComponent();
            var component2 = new Component();
            var component3 = new SubComponent();

            // This filter only includes SubComponents.
            var container = new FilterContainer {
                FilterService = new CustomContainerFilterService()
            };

            container.Add(component1);
            container.Add(component2);
            container.Add(component3);

            Assert.Equal(new IComponent[] { component1, component3 }, container.Components.Cast <IComponent>());

            container.Remove(component1);
            Assert.Equal(new IComponent[] { component3 }, container.Components.Cast <IComponent>());
        }