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); }
public void Should_not_invalidate_other_instances_when_item_added_and_flag_is_false() { 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), false); cache2.Add("Key", 2, TimeSpan.FromMinutes(1), false); AssertCache(cache1, "Key", 1, true); AssertCache(cache2, "Key", 2, true); }
public ReplicatedCacheTests() { sut = new ReplicatedCache(CreateMemoryCache(), pubSub, Options.Create(options)); }
public ReplicatedCacheTests() { sut = new ReplicatedCache(CreateMemoryCache(), pubSub); }