예제 #1
0
        public void TestParentAndChildResolveDifferentInstances()
        {
            var o1 = container.Resolve <ILogger>();
            var o2 = child.Resolve <ILogger>();

            Assert.AreNotSame(o1, o2);
        }
예제 #2
0
        public void TestSiblingContainersResolveDifferentInstances()
        {
            var o1 = child.Resolve <ILogger>();
            var o2 = nestedChild.Resolve <ILogger>();

            Assert.AreNotSame(o1, o2);
        }
예제 #3
0
        public void TestParentResolveActsLikeContainerControlledLifetime()
        {
            var o1 = container.Resolve <ILogger>();
            var o2 = container.Resolve <ILogger>();

            Assert.AreSame(o1, o2);
        }
 public ISingleton ResolveSingleton() => container.Resolve <ISingleton>();