public void Add_CalledOnBoth() { _doubleCache.Add("A", "B"); A.CallTo(() => _local.Add("A", "B")).MustHaveHappened(Repeated.Exactly.Once); A.CallTo(() => _remote.Add("A", "B")).MustHaveHappened(Repeated.Exactly.Once); }
public void Get_ExistingValue_ReturnsValue() { _cacheImplementation.Add(_key, "A"); var result = _cacheImplementation.Get <string>(_key, null); result.ShouldBe("A"); }
public async Task GetAsync_ExistingValue_ReturnsValue() { _cacheImplementation.Add(_key, "A"); var result = await _cacheImplementation.GetAsync <string>(_key, null); result.ShouldBe("A"); }
public void CacheAdd_StaleTtlAddedToTtl() { var key = Guid.NewGuid().ToString(); TimeSpan?ttl = _fakeCache.DefaultTtl.Value.Add(TimeSpan.FromMinutes(1)); _staleCache.Add(key, new object()); A.CallTo(() => _fakeCache.Add(key, A <object> ._, ttl)).MustHaveHappened(Repeated.Exactly.Once); }
public void Add <T>(string key, T item, TimeSpan?timeToLive) { if (timeToLive.HasValue) { _redisCache.Add(key, item, timeToLive.Value.Add(_staleDuration)); } else { _redisCache.Add(key, item); } }
public void Add <T>(string key, T item) { _localCache.Add(key, item); _remoteCache.Add(key, item); }
public void Add_CallsThrough() { _subscribingCache.Add("a", "b"); A.CallTo(() => _decoratedCache.Add("a", "b")).MustHaveHappened(Repeated.Exactly.Once); }
public void Add <T>(string key, T item) { _cache.Add <T>(key, item); }
public void Add <T>(string key, T item) { _cache.Add(key, item); _cachePublisher.NotifyUpdate(key, item.GetType().AssemblyQualifiedName); }
public void Add_DecoratedCache_Called() { _publishingCache.Add("a", "b"); A.CallTo(() => _decoratedCache.Add("a", "b")).MustHaveHappened(Repeated.Exactly.Once); }