Ejemplo n.º 1
0
        public void ManufactureType_Class_With_Despendecies_Dependency_Passed_In_Created_Successfully()
        {
            IClassFactory testClassFactory = new JunctionPointer.Helpers.OCInject.ClassFactory();

            testClassFactory.RegisterType <IDepend, Depend>();
            testClassFactory.RegisterType <ITestClassWithDepend, TestClassWithDepend>();

            IDepend newDepend = new Depend();
            ITestClassWithDepend manufacturedType = testClassFactory.ManufactureType <ITestClassWithDepend>(newDepend);

            Assert.AreSame(newDepend, manufacturedType.Depend);
        }
Ejemplo n.º 2
0
        public void ManufactureType_ClassWithDespendecies_CreatedSuccessfully()
        {
            IClassFactory testClassFactory = new JunctionPointer.Helpers.OCInject.ClassFactory();

            testClassFactory.RegisterType <IDepend, Depend>();
            testClassFactory.RegisterType <ITestClassWithDepend, TestClassWithDepend>();

            ITestClassWithDepend manufacturedType = testClassFactory.ManufactureType <ITestClassWithDepend>();

            Assert.IsTrue(manufacturedType is TestClassWithDepend);
            Assert.IsTrue(manufacturedType.Depend is Depend);
        }