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

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

            Console.ReadKey();
        }
Exemplo 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);
        }