Exemple #1
0
        public void ConfigureObjectFactoryWithAHttpConnectionCacheToCacheAConnection()
        {
            Isolate.Fake.StaticMethods(typeof(ObjectFactory));

            EnvironmentServices.SetHttpSessionCache(_context);
            Isolate.Verify.WasCalledWithAnyArguments(() => ObjectFactory.Configure(x => x.For <IConnectionCache>().Use(_stateCache)));
        }
        public ActionResult SetEnvironment(String environment)
        {
            if (HttpContext.Session != null)
            {
                HttpContext.Session.Add(EnvironmentSetting, environment);
                EnvironmentServices.SetHttpSessionCache(HttpContext.Session);
                EnvironmentServices.SetEnvironment(environment);
            }

            return(this.Direct(new { success = SessionStateManager.GetEnvironment(HttpContext.Session) == environment }));
        }
Exemple #3
0
 public void MakeSureObjectFactoryReturnsAConnectionCacheWhenSetHttpContextIsCalled()
 {
     EnvironmentServices.SetHttpSessionCache(_context);
     try
     {
         ObjectFactory.GetInstance <IConnectionCache>().GetConnection();
     }
     catch (Exception e)
     {
         Assert.Fail(e.ToString());
     }
 }
        public void call_environment_services_to_set_HttpSessionCache_when_logging_in()
        {
            _controller.Login(_user);

            Isolate.Verify.WasCalledWithAnyArguments(() => EnvironmentServices.SetHttpSessionCache(_sessionState));
        }
        public void provide_the_HttpSessionState_to_environment_services_when_set_environment_is_called()
        {
            _controller.SetEnvironment(Testgenform);

            Isolate.Verify.WasCalledWithAnyArguments(() => EnvironmentServices.SetHttpSessionCache(_sessionState));
        }