public void ShouldGetInstanceForType() { var type = typeof(object); var instance = new DefaultClassInstanceManager().Get(type); Assert.NotNull(instance); Assert.AreEqual(instance.GetType(), type); }
public void ShouldGetMemoizedInstanceForType() { var instanceManager = new DefaultClassInstanceManager(); var type = typeof(object); var instance = instanceManager.Get(type); var anotherInstance = instanceManager.Get(type); Assert.AreSame(instance, anotherInstance); }