Exemple #1
0
        public void ShouldGetInstanceForType()
        {
            var type     = typeof(object);
            var instance = new DefaultClassInstanceManager().Get(type);

            Assert.NotNull(instance);
            Assert.AreEqual(instance.GetType(), type);
        }
Exemple #2
0
        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);
        }