Exemplo n.º 1
0
        public void Installers_defined_after_SessionFactoryResolver_are_processed()
        {
            var container = new WindsorContainer();
            var sessionFactoryResolver = new SessionFactoryResolver(container.Kernel);

            // Register installer prior to registering
            container.Register(
                Component.For<IConfigurationBuilder>()
                    .ImplementedBy<DefaultInstaller>()
                );

            Assert.IsTrue(sessionFactoryResolver.IsAliasDefined("default-installer"));
        }
Exemplo n.º 2
0
        public void Installers_with_dependencies_are_processed_when_possible()
        {
            var container = new WindsorContainer();
            var sessionFactoryResolver = new SessionFactoryResolver(container.Kernel);

            // Register installer prior to registering
            container.Register(
                Component.For<IConfigurationBuilder>()
                    .ImplementedBy<InstallerWithDependency>()
                );

            Assert.IsFalse(sessionFactoryResolver.IsAliasDefined("installer-with-dependency"));

            container.Register(Component.For<DependencyClass>());

            Assert.IsTrue(sessionFactoryResolver.IsAliasDefined("installer-with-dependency"));
        }