Example #1
0
        public void Registered_Interface_Implementation()
        {
            ITest test = new TestImplementationOne();

            injector.RegisterInstance <ITest>(test);

            DependencyTestClass classWithDependency = new DependencyTestClass();

            injector.InjectMethod(classWithDependency);

            Assert.IsNotNull(classWithDependency.dependency);
            Assert.IsInstanceOf <TestImplementationOne>(classWithDependency.dependency);
        }
            public TestServiceWithFactory Construct()
            {
                ITestInterface implementation;

                if (useOne)
                {
                    implementation = new TestImplementationOne();
                }
                else
                {
                    implementation = new TestImplementationTwo();
                }

                return(new TestServiceWithFactory(implementation));
            }