Ejemplo n.º 1
0
        public void RemoveGenericComponentInterfaceDestroyable()
        {
            var         component = new TestDestroyableComponent();
            IComposable container = new ComposableDefault(component);

            // Disable in component
            container.RemoveComponent <IDestroyable>();

            Assert.IsTrue(container.CountComponents == 0);
            Assert.IsTrue(component.Destroyed);
        }
Ejemplo n.º 2
0
        public void RemoveComponents()
        {
            var activableComponent = new TestActivableComponent();

            activableComponent.Enable();
            var destroyableComponent = new TestDestroyableComponent();

            IComposable container = new ComposableDefault(
                new TestComponent(),
                new TestUpdatableComponent(),
                new TestNestedComponent(),
                activableComponent,
                destroyableComponent
                );

            container.RemoveComponents();
            Assert.IsTrue(container.CountComponents == 0);
            Assert.IsTrue(activableComponent.Enabled == false);
            Assert.IsTrue(destroyableComponent.Destroyed);
        }