public void Should_serve_from_cache() { sut.Add("Key", 1, TimeSpan.FromMinutes(10), true); AssertCache(sut, "Key", 1, true); sut.Remove("Key"); AssertCache(sut, "Key", null, false); }
public void Should_invalidate_other_instances_when_item_removed() { var cache1 = new ReplicatedCache(CreateMemoryCache(), pubSub, Options.Create(options)); var cache2 = new ReplicatedCache(CreateMemoryCache(), pubSub, Options.Create(options)); cache1.Add("Key", 1, TimeSpan.FromMinutes(1), true); cache2.Remove("Key"); AssertCache(cache1, "Key", null, false); AssertCache(cache2, "Key", null, false); }