Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
 public ReplicatedCacheTests()
 {
     sut = new ReplicatedCache(CreateMemoryCache(), pubSub, Options.Create(options));
 }
Beispiel #4
0
 public ReplicatedCacheTests()
 {
     sut = new ReplicatedCache(CreateMemoryCache(), pubSub);
 }