Beispiel #1
0
        private static void SetupInMemoryDatabase(ISessionStateCache stateCache, IDbConnection conn)
        {
            var fact = SessionFactoryManager.GetSessionFactory(stateCache.GetEnvironment());
            stateCache.SetSessionFactory(fact);

            UseSessionFactoryFromApplicationOrSessionCache(stateCache);
            var session = ObjectFactory.GetInstance<ISessionFactory>().OpenSession(conn);

            SessionFactoryManager.BuildSchema(stateCache.GetEnvironment(), session);
            CurrentSessionContext.Bind(session);

            UserServices.ConfigureSystemUser();
        }
        private static void SetupInMemoryDatabase(ISessionStateCache stateCache, IDbConnection conn)
        {
            var fact = SessionFactoryManager.GetSessionFactory(stateCache.GetEnvironment());

            stateCache.SetSessionFactory(fact);

            UseSessionFactoryFromApplicationOrSessionCache(stateCache);
            var session = ObjectFactory.GetInstance <ISessionFactory>().OpenSession(conn);

            SessionFactoryManager.BuildSchema(stateCache.GetEnvironment(), session);
            CurrentSessionContext.Bind(session);

            UserServices.ConfigureSystemUser();
        }
        private static void SetupConfiguration(ISessionStateCache stateCache)
        {
            var environment = stateCache.GetEnvironment();
            var envConf     = ConfigurationManager.Instance.GetConfiguration(environment);

            envConf.GetConnection();
        }
Beispiel #4
0
 private static void UseSessionFactoryFromApplicationOrSessionCache(ISessionStateCache stateCache)
 {
     if (IsEmptyCache(stateCache))
         ObjectFactory.Configure(
             x =>
             x.For<ISessionFactory>().Use(GenFormApplication.GetSessionFactory(stateCache.GetEnvironment())));
     else
     {
         ObjectFactory.Configure(
             x =>
             x.For<ISessionFactory>().Use(stateCache.GetSessionFactory));
     }
 }
Beispiel #5
0
 private static void SetupConfiguration(ISessionStateCache stateCache)
 {
     var environment = stateCache.GetEnvironment();
     var envConf = ConfigurationManager.Instance.GetConfiguration(environment);
     envConf.GetConnection();
 }
Beispiel #6
0
        public void get_the_default_TestGenForm_environment_if_no_environment_in_SessionState()
        {
            Isolate.WhenCalled(() => _sessionState[HttpSessionStateCache.EnvironmentSetting]).WillReturn("TestGenForm");

            Assert.AreEqual("TestGenForm", _stateCache.GetEnvironment());
        }
 private static void UseSessionFactoryFromApplicationOrSessionCache(ISessionStateCache stateCache)
 {
     if (IsEmptyCache(stateCache))
     {
         ObjectFactory.Configure(
             x =>
             x.For <ISessionFactory>().Use(GenFormApplication.GetSessionFactory(stateCache.GetEnvironment())));
     }
     else
     {
         ObjectFactory.Configure(
             x =>
             x.For <ISessionFactory>().Use(stateCache.GetSessionFactory));
     }
 }