[TestMethod]// log Bug
        public void TestMethodwithParamaterAsInterface()
        {
            IUnityContainer uc = new UnityContainer();

            uc.RegisterType <InjectionTestInterface, InjectionTestClass2>()
            .RegisterType <InjectionTestInterface, InjectionTestClass2>("hi")
            .RegisterType <InjectionTestInterface, InjectionTestClass1>()
            .RegisterType <InjectionTestInterface, InjectionTestClass1>("hello");

            InjectionTestInterface obj3 = uc.Resolve <InjectionTestInterface>("hi");
            InjectionTestInterface obj2 = uc.Resolve <InjectionTestInterface>("hello");
        }
 public InjectionTestClass2(InjectionTestInterface intobj1)
 {
     this.intobj  = intobj1;
     intobj1.Text = "Hello";
 }
Пример #3
0
 public InjectionTestClass2(InjectionTestInterface intobj1)
 {
     this.intobj = intobj1;
     intobj1.Text = "Hello";
 }