public void RemoveComponents2()
        {
            IComposable container = new ComposableDefault();

            container.RemoveComponents(typeof(TestComponent));
            Assert.IsTrue(container.CountComponents == 0);
        }
        public void RemoveGenericComponents2()
        {
            IComposable container = new ComposableDefault();

            container.RemoveComponents <TestComponent>();
            Assert.IsTrue(container.CountComponents == 0);
        }
        public void GetGenericComponents6()
        {
            IComponent  addedComponent = new TestUpdatableComponent();
            IComposable container      = new ComposableDefault(addedComponent);

            IComponent[] components = container.GetComponents <TestComponent>();
            Assert.IsTrue(components.Length == 0);
        }
        public void AddComponents()
        {
            IComposable container = new ComposableDefault();

            container.AddComponents(new TestComponent());

            Assert.IsTrue(container.CountComponents == 1);
        }
        public void RemoveGenericComponent5()
        {
            IComposable container = new ComposableDefault(
                new TestUpdatableComponent()
                );

            container.RemoveComponent <TestComponent>();
            Assert.IsTrue(container.CountComponents == 1);
        }
        public void RemoveGenericComponentInterface1()
        {
            IComposable container = new ComposableDefault(
                new TestUpdatableComponent()
                );

            container.RemoveComponent <IUpdatable>();
            Assert.IsTrue(container.CountComponents == 0);
        }
        public void GetComponentInterface2()
        {
            IComponent  addedComponent = new TestUpdatableComponent();
            IComposable container      = new ComposableDefault(addedComponent);

            IComponent component = container.GetComponent(typeof(IComponent));

            Assert.AreEqual(addedComponent, component);
        }
        public void GetComponentNested()
        {
            IComponent  addedComponent = new TestNestedComponent();
            IComposable container      = new ComposableDefault(addedComponent);

            IComponent component = container.GetComponent(typeof(TestComponent));

            Assert.AreEqual(addedComponent, component);
        }
        public void GetGenericComponentInterface1()
        {
            IComponent  addedComponent = new TestUpdatableComponent();
            IComposable container      = new ComposableDefault(addedComponent);

            IComponent component = container.GetComponent <IUpdatable>() as IComponent;

            Assert.AreEqual(addedComponent, component);
        }
Esempio n. 10
0
        public void GetGenericComponent()
        {
            IComponent  addedComponent = new TestComponent();
            IComposable container      = new ComposableDefault(addedComponent);

            IComponent component = container.GetComponent <TestComponent>();

            Assert.AreEqual(addedComponent, component);
        }
Esempio n. 11
0
        public void ContainsGenericComponentInterface1()
        {
            IComposable container = new ComposableDefault(
                new TestUpdatableComponent()
                );

            bool result = container.ContainsComponent <IUpdatable>();

            Assert.IsTrue(result);
        }
Esempio n. 12
0
        public void RemoveComponent2()
        {
            IComposable container = new ComposableDefault(
                new TestComponent(),
                new TestUpdatableComponent()
                );

            container.RemoveComponent(typeof(TestComponent));
            Assert.IsTrue(container.CountComponents == 1);
        }
Esempio n. 13
0
        public void ContainsComponentNested()
        {
            IComposable container = new ComposableDefault(
                new TestNestedComponent()
                );

            bool result = container.ContainsComponent(typeof(TestComponent));

            Assert.IsTrue(result);
        }
Esempio n. 14
0
        public void RemoveGenericComponent4()
        {
            IComposable container = new ComposableDefault(
                new TestComponent(),
                new TestNestedComponent()
                );

            container.RemoveComponent <IUpdatable>();
            Assert.IsTrue(container.CountComponents == 2);
        }
Esempio n. 15
0
        public void ContainsGenericComponent2()
        {
            IComposable container = new ComposableDefault(
                new TestUpdatableComponent()
                );

            bool result = container.ContainsComponent <TestComponent>();

            Assert.IsTrue(result == false);
        }
Esempio n. 16
0
        public void ContainsComponentInterface2()
        {
            IComposable container = new ComposableDefault(
                new TestComponent()
                );

            bool result = container.ContainsComponent(typeof(IUpdatable));

            Assert.IsTrue(result == false);
        }
Esempio n. 17
0
        public void ContainsComponents3()
        {
            IComposable container = new ComposableDefault(
                new TestComponent()
                );

            bool result = container.ContainsComponents(typeof(IComponent), typeof(TestUpdatableComponent));

            Assert.IsTrue(result == false);
        }
Esempio n. 18
0
        public void GetComponents5()
        {
            IComponent  addedComponent1 = new TestComponent();
            IComponent  addedComponent2 = new TestNestedComponent();
            IComposable container       = new ComposableDefault(
                addedComponent1, addedComponent2
                );

            IComponent[] components = container.GetComponents(typeof(IUpdatable));
            Assert.IsTrue(components.Length == 0);
        }
Esempio n. 19
0
        public void RemoveGenericComponentsInterface2()
        {
            IComposable container = new ComposableDefault(
                new TestComponent(),
                new TestUpdatableComponent(),
                new TestNestedComponent()
                );

            container.RemoveComponents <IComponent>();
            Assert.IsTrue(container.CountComponents == 0);
        }
Esempio n. 20
0
        public void RemoveComponentsInterface1()
        {
            IComposable container = new ComposableDefault(
                new TestComponent(),
                new TestUpdatableComponent(),
                new TestNestedComponent()
                );

            container.RemoveComponents(typeof(IUpdatable));
            Assert.IsTrue(container.CountComponents == 2);
        }
Esempio n. 21
0
        public void GetGenericComponents4()
        {
            IComponent  addedComponent1 = new TestComponent();
            IComponent  addedComponent2 = new TestNestedComponent();
            IComposable container       = new ComposableDefault(
                addedComponent1, addedComponent2
                );

            IUpdatable[] updatables = container.GetComponents <IUpdatable>();
            Assert.IsTrue(updatables.Length == 0);
        }
Esempio n. 22
0
        public void TryGetGenericComponentInterface2()
        {
            IComponent  addedComponent = new TestComponent();
            IComposable container      = new ComposableDefault(addedComponent);

            IUpdatable updatable;
            bool       result = container.TryGetComponent <IUpdatable>(out updatable);

            Assert.IsTrue(result == false);
            Assert.IsNull(updatable);
        }
Esempio n. 23
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);
        }
Esempio n. 24
0
        public void TryGetComponentInterface2()
        {
            IComponent  addedComponent = new TestComponent();
            IComposable container      = new ComposableDefault(addedComponent);

            IComponent component;
            bool       result = container.TryGetComponent(typeof(IUpdatable), out component);

            Assert.IsTrue(result == false);
            Assert.IsNull(component);
        }
Esempio n. 25
0
        public void TryGetGenericComponent2()
        {
            IComponent  addedComponent = new TestUpdatableComponent();
            IComposable container      = new ComposableDefault(addedComponent);

            TestComponent component;
            bool          result = container.TryGetComponent <TestComponent>(out component);

            Assert.IsTrue(result == false);
            Assert.IsNull(component);
        }
Esempio n. 26
0
        public void RemoveGenericComponentNested2()
        {
            IComposable container = new ComposableDefault(
                new TestComponent(),
                new TestUpdatableComponent(),
                new TestNestedComponent()
                );

            // Remove one first component
            container.RemoveComponent <TestComponent>();
            Assert.IsTrue(container.CountComponents == 2);
        }
Esempio n. 27
0
        public void GetGenericComponents3()
        {
            IComponent  addedComponent1 = new TestComponent();
            IComponent  addedComponent2 = new TestUpdatableComponent();
            IComponent  addedComponent3 = new TestNestedComponent();
            IComposable container       = new ComposableDefault(
                addedComponent1, addedComponent2, addedComponent3
                );

            IComponent[] components = container.GetComponents <TestComponent>();
            Assert.IsTrue(components.Length == 2);
        }
Esempio n. 28
0
        public void RemoveComponentInterface3()
        {
            IComposable container = new ComposableDefault(
                new TestComponent(),
                new TestUpdatableComponent(),
                new TestNestedComponent()
                );

            // Remove one first component
            container.RemoveComponent(typeof(IComponent));
            Assert.IsTrue(container.CountComponents == 2);
        }
Esempio n. 29
0
        public void TryGetComponentInterface1()
        {
            IComponent  addedComponent = new TestUpdatableComponent();
            IComposable container      = new ComposableDefault(addedComponent);

            IComponent component;
            bool       result = container.TryGetComponent(typeof(IUpdatable), out component);

            Assert.IsTrue(result);
            Assert.IsNotNull(component);
            Assert.AreEqual(addedComponent, component);
        }
Esempio n. 30
0
        public void TryGetGenericComponentNested()
        {
            IComponent  addedComponent = new TestNestedComponent();
            IComposable container      = new ComposableDefault(addedComponent);

            TestComponent component;
            bool          result = container.TryGetComponent <TestComponent>(out component);

            Assert.IsTrue(result);
            Assert.IsNotNull(component);
            Assert.AreEqual(addedComponent, component);
        }