public void CachedValuesOfBaseType()
        {
            HttpSessionStateBase session = mocks.HtmlHelper.ViewContext.HttpContext.Session;

            session.AddValueToSession("key1", 1);
            Assert.AreEqual(1, session.GetValueFromSession <int>("key1"));
        }
        public void CachedValuesOfDifferentType()
        {
            HttpSessionStateBase session = mocks.HtmlHelper.ViewContext.HttpContext.Session;

            session.AddValueToSession("key1", 1);
            Assert.IsNull(session.GetValueFromSession <long>("key1"));
        }
        public void AddValueToSession()
        {
            HttpSessionStateBase session   = mocks.HtmlHelper.ViewContext.HttpContext.Session;
            const int            testvalue = 99;

            session.AddValueToSession("key1", testvalue);
            Assert.AreEqual(testvalue, session.GetValueFromSession <int>("key1"));
        }
        public void RemoveValueFromCache()
        {
            HttpSessionStateBase session = mocks.HtmlHelper.ViewContext.HttpContext.Session;

            session.AddValueToSession("key1", 1);
            Assert.AreEqual(1, session.GetValueFromSession <int>("key1"));
            session.ClearFromSession("key1");
            Assert.IsNull(session.GetValueFromSession <int>("key1"));
        }