예제 #1
0
        public void TransientRegister_Success()
        {
            ITestCase testCase = new TestCaseA();

            var c = new ServiceContainer();
            c = (ServiceContainer)testCase.TransientRegister(c);

            var obj1 = c.GetInstance<ITestA>();
            var obj2 = c.GetInstance<ITestA>();

            Assert.AreNotEqual(obj1, obj2);
            Helper.Check(obj1, false);
            Helper.Check(obj2, false);
        }
예제 #2
0
        public void SingletonRegister_Success()
        {
            ITestCase testCase = new TestCaseA();

            var c = new ServiceContainer();
            c = (ServiceContainer)testCase.SingletonRegister(c);

            var obj1 = c.GetInstance<ITestA>();
            var obj2 = c.GetInstance<ITestA>();

            Assert.AreEqual(obj1, obj2);
            Helper.Check(obj1, true);
            Helper.Check(obj2, true);
        }