示例#1
0
        public void SingletonRegistration()
        {
            IContainer container = new IocContainer.Container();

            container.RegisterSingletonType <ITest1, ClassTest1>();

            ITest1 obj1 = container.Resolve <ITest1>();

            Assert.Equal("ClassTest1", obj1.Name());
        }
示例#2
0
        public void InstanceTypeResigtration()
        {
            IContainer container = new IocContainer.Container();

            // testing instance type resigtration for class
            container.RegisterInstanceType <ITest1, ClassTest1>();

            ITest1 obj1 = container.Resolve <ITest1>();

            Assert.Equal("ClassTest1", obj1.Name());
        }
示例#3
0
 public string FunctionTwo()
 {
     return(m_Itest1.Name());
 }