Esempio n. 1
0
        static void Main(string[] args)
        {
            ICacheStorage cacheStorage = new HttpContextCache();

            cacheStorage.Store("abc", "abc", new TimeSpan(0, 1, 0));

            Console.ReadKey();
        }
Esempio n. 2
0
        public void StoreTest()
        {
            const string expectedKey   = "test2";
            const string expectedValue = "test2";

            GenerateFakeHttpContext();

            var cache = new HttpContextCache();

            cache.Store(expectedKey, expectedValue);

            var retrieved = cache.Retrieve <string>(expectedKey);

            Assert.AreEqual(expectedValue, retrieved);
        }