public void Delete_CalledOnBoth()
        {
            _doubleCache.Remove("A");

            A.CallTo(() => _local.Remove("A")).MustHaveHappened(Repeated.Exactly.Once);
            A.CallTo(() => _remote.Remove("A")).MustHaveHappened(Repeated.Exactly.Once);
        }
Пример #2
0
        public async Task SubscriberDelete_ItemDelete()
        {
            _subscriber.CacheDelete += Raise.With(this, new CacheUpdateNotificationArgs {
                Key = "a"
            });

            await Task.Delay(TimeSpan.FromSeconds(1));

            A.CallTo(() => _decoratedCache.Remove("a"))
            .MustHaveHappened(Repeated.Exactly.Once);
        }
Пример #3
0
        public async Task Remove_ExistingKey_DeletesValue()
        {
            var func = A.Fake <Func <Task <string> > >();

            A.CallTo(() => func.Invoke()).Returns("B");

            _cacheImplementation.Add(_key, "A");

            _cacheImplementation.Remove(_key);

            var result = await _cacheImplementation.GetAsync(_key, func);

            A.CallTo(() => func.Invoke()).MustHaveHappened(Repeated.Exactly.Once);
            result.ShouldBe("B");
        }
Пример #4
0
 public void Remove(string key)
 {
     _localCache.Remove(key);
     _remoteCache.Remove(key);
 }
Пример #5
0
        public IHttpActionResult Remove()
        {
            _pubSubCache.Remove(Request.RequestUri.PathAndQuery);

            return(ResponseMessage(new HttpResponseMessage(HttpStatusCode.NoContent)));
        }
Пример #6
0
 public void Remove(string key)
 {
     _redisCache.Remove(key);
 }
Пример #7
0
 public void Remove(string key)
 {
     _cache.Remove(key);
 }
Пример #8
0
 public void Remove(string key)
 {
     _cache.Remove(key);
     _cachePublisher.NotifyDelete(key);
 }
        public void Remove_DecoratedCache_Called()
        {
            _publishingCache.Remove("a");

            A.CallTo(() => _decoratedCache.Remove("a")).MustHaveHappened(Repeated.Exactly.Once);
        }