public void CacheHitTest() { var cache = new CacheDb(); var fewMinutesAgo = TimeSpan.FromMinutes(30.0); cache.Add("key", fewMinutesAgo, "value"); var value = cache.Get("key"); Assert.AreEqual("value", value); }
public void CacheHitExpiredTest() { var cache = new CacheDb(); var twoHoursAgo = TimeSpan.FromHours(-2.0); cache.Add("key", twoHoursAgo, "value"); var value = cache.Get("key"); Assert.IsNull(value); }