Пример #1
0
        public static IWindsorEngine Start()
        {
            var            rootLibrary   = new SynergyCoreTestLibrary();
            IWindsorEngine windsorEngine = new WindsorEngine();

            windsorEngine.Start(rootLibrary);
            return(windsorEngine);
        }
        public void can_start_windsor_engine()
        {
            // ARRANGE
            var rootLibrary = new SynergyCoreTestLibrary();

            using (IWindsorEngine windsorEngine = new WindsorEngine())
            {
                // ACT
                windsorEngine.Start(rootLibrary);

                // ASSERT
                var component = windsorEngine.GetComponent <IComponentMock>();
                Assert.IsAssignableFrom <ComponentMock>(component);
            }
        }
Пример #3
0
        public void database_can_be_opened()
        {
            using (new SessionThreadStaticScope())
            {
                // ARRANGE
                var            rootLibrary   = new SynergyNHibernateTestLibrary();
                IWindsorEngine windsorEngine = new WindsorEngine();
                windsorEngine.Start(rootLibrary);
                var db = windsorEngine.GetComponent <IMyDatabase>();

                // ACT
                ISession session = db.OpenSession();

                // ASSERT
                session.Dispose();
                windsorEngine.Dispose();
            }
        }
Пример #4
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            var            rootLibrary   = new SynergyNHibernateSampleLibrary();
            IWindsorEngine windsorEngine = new WindsorEngine();

            windsorEngine.Start(rootLibrary);
            var db = windsorEngine.GetComponent <ISampleDatabase>();

            db.Open();

            var controllerFactory = windsorEngine.GetComponent <IControllerFactory>();

            ControllerBuilder.Current.SetControllerFactory(controllerFactory);
        }
        public static IWindsorEngine Start()
        {
            var            rootLibrary   = new SynergyNHibernateTestLibrary();
            IWindsorEngine windsorEngine = new WindsorEngine();

            windsorEngine.Start(rootLibrary);

            var db = windsorEngine.GetComponent <IMyDatabase>();

            db.Open();
            //using (db.OpenSession())
            {
                db.OpenSession();
                var schema = windsorEngine.GetComponent <IDatabaseSchema>();
                schema.CreateFor(db);
            }


            return(windsorEngine);
        }