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); }
public void GetGenericComponent() { IComponent addedComponent = new TestComponent(); IComposable container = new ComposableDefault(addedComponent); IComponent component = container.GetComponent <TestComponent>(); Assert.AreEqual(addedComponent, component); }
public void ContainsGenericComponentInterface1() { IComposable container = new ComposableDefault( new TestUpdatableComponent() ); bool result = container.ContainsComponent <IUpdatable>(); Assert.IsTrue(result); }
public void RemoveComponent2() { IComposable container = new ComposableDefault( new TestComponent(), new TestUpdatableComponent() ); container.RemoveComponent(typeof(TestComponent)); Assert.IsTrue(container.CountComponents == 1); }
public void ContainsComponentNested() { IComposable container = new ComposableDefault( new TestNestedComponent() ); bool result = container.ContainsComponent(typeof(TestComponent)); Assert.IsTrue(result); }
public void RemoveGenericComponent4() { IComposable container = new ComposableDefault( new TestComponent(), new TestNestedComponent() ); container.RemoveComponent <IUpdatable>(); Assert.IsTrue(container.CountComponents == 2); }
public void ContainsGenericComponent2() { IComposable container = new ComposableDefault( new TestUpdatableComponent() ); bool result = container.ContainsComponent <TestComponent>(); Assert.IsTrue(result == false); }
public void ContainsComponentInterface2() { IComposable container = new ComposableDefault( new TestComponent() ); bool result = container.ContainsComponent(typeof(IUpdatable)); Assert.IsTrue(result == false); }
public void ContainsComponents3() { IComposable container = new ComposableDefault( new TestComponent() ); bool result = container.ContainsComponents(typeof(IComponent), typeof(TestUpdatableComponent)); Assert.IsTrue(result == false); }
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); }
public void RemoveGenericComponentsInterface2() { IComposable container = new ComposableDefault( new TestComponent(), new TestUpdatableComponent(), new TestNestedComponent() ); container.RemoveComponents <IComponent>(); Assert.IsTrue(container.CountComponents == 0); }
public void RemoveComponentsInterface1() { IComposable container = new ComposableDefault( new TestComponent(), new TestUpdatableComponent(), new TestNestedComponent() ); container.RemoveComponents(typeof(IUpdatable)); Assert.IsTrue(container.CountComponents == 2); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }