コード例 #1
0
        public void InjectionFailDependencyNotFound()
        {
            SimpleDependencyInjector di = new SimpleDependencyInjector();

            di.Register(typeof(MyClass), typeof(IClass));
            di.Register(typeof(MyClass3), typeof(IClass3));

            TestClass testClass = di.CallCtor(typeof(TestClass)) as TestClass;
        }
コード例 #2
0
        public void InjectionFaiedInstanseNotFounded()
        {
            SimpleDependencyInjector di = new SimpleDependencyInjector();

            di.Register(typeof(MyClass), typeof(IClass));

            TestClass testClass = di.CallCtor(typeof(TestClass)) as TestClass;

            Assert.AreEqual(true, testClass.IsGood);
        }