internal void Register(IWindsorContainer container)
        {
            var service = typeof(TService);
            var key     = SubstituterFacility.TestKey(service);

            var componentRegistration = Component.For <TService>().Named(key);

            if (null == _componentType)
            {
                componentRegistration.UsingFactoryMethod(_factory);
            }
            else
            {
                componentRegistration.ImplementedBy(_componentType);
            }

            container.Register(componentRegistration);
        }
Example #2
0
        public IHandler SelectHandler(string key, Type service, IHandler[] handlers)
        {
            var testKey = SubstituterFacility.TestKey(service);

            return(_container.Kernel.GetHandler(testKey));
        }
Example #3
0
        public bool HasOpinionAbout(string key, Type service)
        {
            var testKey = SubstituterFacility.TestKey(service);

            return(_container.Kernel.HasComponent(testKey));
        }