public void SpecialCharacterTest() { IUnityContainer uc = new UnityContainer(); uc.RegisterType <MyMethodTest>("@Foo!@"); MyMethodTest objspecial = uc.Resolve <MyMethodTest>("@Foo!@"); Assert.IsNotNull(objspecial); }
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; }
public void Initialize(MyMethodTest obj, IMyMethodInterface objint) { Myobj = obj; MyInterface = objint; }