public void RetrieveTest() { GenerateFakeHttpContext(); var cache = new HttpContextCache(); var retrieved = cache.Retrieve <string>(TestKey); Assert.AreEqual(TestValue, retrieved); }
public void RetrieveNonExistingTest() { var tmpKey = TestKey + "123"; GenerateFakeHttpContext(); var cache = new HttpContextCache(); var retrieved = cache.Retrieve <string>(tmpKey); Assert.IsNull(retrieved); }
public void RemoveTest() { GenerateFakeHttpContext(); var cache = new HttpContextCache(); cache.Remove(TestKey); var retrieved = cache.Retrieve <string>(TestKey); Assert.IsNull(retrieved); }
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); }