Ejemplo n.º 1
0
        public void SpecialCharacterTest()
        {
            IUnityContainer uc = new UnityContainer();

            uc.RegisterType <MyMethodTest>("@Foo!@");

            MyMethodTest objspecial = uc.Resolve <MyMethodTest>("@Foo!@");

            Assert.IsNotNull(objspecial);
        }
Ejemplo n.º 2
0
        public void HappyMethodInjection()
        {
            UnityContainer uc = new UnityContainer();

            uc.RegisterType <IMyMethodInterface, MyMethodTest>()
            .RegisterType <MyMethodTest, MyMethodTest1>();

            MyMethodTest2 mytestobj = uc.Resolve <MyMethodTest2>();

            mytestobj.Myobj.Strs = "I am Initialized";
            IMyMethodInterface newobj       = mytestobj.MyInterface;
            MyMethodTest       newobjmethod = mytestobj.Myobj;
        }
Ejemplo n.º 3
0
 public void Initialize(MyMethodTest obj, IMyMethodInterface objint)
 {
     Myobj       = obj;
     MyInterface = objint;
 }