public void ShouldGetMemoizedInstanceForType() { var type = typeof(object); var instance = ClassInstanceManager.Get(type); var anotherInstance = ClassInstanceManager.Get(type); Assert.AreSame(instance, anotherInstance); }
public void ShouldGetInstanceForType() { var type = typeof(object); var instance = ClassInstanceManager.Get(type); Assert.NotNull(instance); Assert.AreEqual(instance.GetType(), type); }
public void ShouldNotGetMemoizedInstanceForTypeWhenClassObjectMapIsCleared() { var type = typeof(object); var instance = ClassInstanceManager.Get(type); ClassInstanceManager.ClearCache(); var anotherInstance = ClassInstanceManager.Get(type); Assert.AreNotSame(instance, anotherInstance); }