public void TestSetStringTwice() { using (var externalCache = new ExternalCache()) { externalCache.Set("Item 1", "Value 1", new TimeSpan(10000000)); // 10000 ticks = 1ms var item = (string)externalCache.Get("Item 1"); Assert.AreEqual("Value 1", item); externalCache.Set("Item 1", "Value 2", new TimeSpan(10000000)); // 10000 ticks = 1ms item = (string)externalCache.Get("Item 1"); Assert.AreEqual("Value 2", item); } }
public void TestSetStringAndLetItExpireByAbsoluteTime() { using (var externalCache = new ExternalCache()) { externalCache.Set("Item 1", "Value 1", new DateTimeOffset(DateTime.Now.AddMilliseconds(1000))); CheckItem1AsString(externalCache); } }
public void TestSetStringAndLetItExpireByTicks() { using (var externalCache = new ExternalCache()) { externalCache.Set("Item 1", "Value 1", new TimeSpan(10000000)); // 10000 ticks = 1ms CheckItem1AsString(externalCache); } }
public void TestSetObjectAndLetItExpireByAbsoluteTime() { using (var externalCache = new ExternalCache()) { var item = new Dynamo(); item["P1"] = "Property 1"; externalCache.Set("Item 1", item, DateTime.Now.AddMilliseconds(1000)); CheckItem1(externalCache); } }
public void TestSetObjectAndLetItExpireByTicks() { using (var externalCache = new ExternalCache()) { var item = new Dynamo(); item["P1"] = "Property 1"; externalCache.Set("Item 1", item, new TimeSpan(10000000)); // 10000 ticks = 1ms CheckItem1(externalCache); } }