public void GetGenericComponents6() { IComponent addedComponent = new TestUpdatableComponent(); IComposable container = new ComposableDefault(addedComponent); IComponent[] components = container.GetComponents <TestComponent>(); Assert.IsTrue(components.Length == 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 GetGenericComponentInterface1() { IComponent addedComponent = new TestUpdatableComponent(); IComposable container = new ComposableDefault(addedComponent); IComponent component = container.GetComponent <IUpdatable>() as IComponent; Assert.AreEqual(addedComponent, 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 TryGetComponent3() { IComponent addedComponent = new TestUpdatableComponent(); IComposable container = new ComposableDefault(addedComponent); IComponent component; bool result = container.TryGetComponent(typeof(TestComponent), out component); Assert.IsTrue(result == false); Assert.IsNull(component); }
public void TryGetGenericComponentInterface1() { IComponent addedComponent = new TestUpdatableComponent(); IComposable container = new ComposableDefault(addedComponent); IUpdatable updatable; bool result = container.TryGetComponent <IUpdatable>(out updatable); Assert.IsTrue(result); Assert.IsNotNull(updatable); Assert.AreEqual(addedComponent, updatable); }
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 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 GetComponents2() { IComponent addedComponent1 = new TestComponent(); IComponent addedComponent2 = new TestUpdatableComponent(); IComponent addedComponent3 = new TestNestedComponent(); IComposable container = new ComposableDefault( addedComponent1, addedComponent2, addedComponent3 ); IComponent[] components = container.GetComponents(typeof(IComponent)); Assert.IsTrue(components.Length == 3); }
public void GetGenericComponents2() { IComponent addedComponent1 = new TestComponent(); IComponent addedComponent2 = new TestUpdatableComponent(); IComponent addedComponent3 = new TestNestedComponent(); IComposable container = new ComposableDefault( addedComponent1, addedComponent2, addedComponent3 ); IUpdatable[] updatables = container.GetComponents <IUpdatable>(); Assert.IsTrue(updatables.Length == 1); Assert.AreEqual(addedComponent2, updatables[0]); }