public void ShouldConstructAnObjectThatHasClassesForCDsByInstantiatingDependenciesIfTheyAreNotRegistered() { TestClassWithClassDependencies constructed = (TestClassWithClassDependencies)store.GetByType(typeof(TestClassWithClassDependencies)); Assert.IsNotNull(constructed); Assert.IsNotNull(constructed.Dependency); }
public void ShouldConstructAnObjectThatHasClassesForCDsByInstantiatingDependenciesIfTheyAreNotRegisteredWhenReferencedById() { store.AddTypeForName("foo", typeof(TestClassWithClassDependencies)); TestClassWithClassDependencies constructed = (TestClassWithClassDependencies)store.GetByName("foo"); Assert.IsNotNull(constructed); Assert.IsNotNull(constructed.Dependency); }
public void ShouldConstructAnObjectThatHasClassesForCDsByUsingRegisteredInstancesIfTheyAreRegistered() { TestClass dependency = new TestClass(); store.AddInstanceForType(typeof(TestClass), dependency); TestClassWithClassDependencies constructed = (TestClassWithClassDependencies)store.GetByType(typeof(TestClassWithClassDependencies)); Assert.IsNotNull(constructed); Assert.AreSame(dependency, constructed.Dependency); }