public void SetUp() { _cachedItem = new TDataMock(); _cacheKey = new DefaultCacheKeyConverter().ConvertCacheKey<TDataMock, int>("", _lookupKey); _cacheTimeout = RMM.GenerateStrictMock<ICacheTimeout>(); _contextCacheMock = RMM.GenerateStrictMock<IContextCache>(); _volatileCacheMock = RMM.GenerateStrictMock<IVolatileCache>(); _longTermCacheMock = RMM.GenerateStrictMock<ILongTermCache>(); _configurationMock = RMM.GenerateStub<IBlendedCacheConfiguration>(); RME.Stub(_configurationMock, x => x.GetCacheTimeoutForTypeOrDefault(_cachedItem.GetType())).Return(_cacheTimeout); _setterMock = RMM.GenerateStrictMock<ICacheSetter>(); RME.Stub(_setterMock, x => x.Set<TDataMock>(null, null, null, SetCacheLocation.NotSet, null, null, null)).IgnoreArguments() .Do(new Action<string, TDataMock, ICacheTimeout, SetCacheLocation, IContextCache, IVolatileCache, ILongTermCache>( (passedCacheKey, passedCachedItem, passedTimeout, passedLocation, passedContext, passedVolatile, passedLongTerm) => { _passedCacheKey = passedCacheKey; _passedCachedItem = passedCachedItem; _passedCacheTimeout = passedTimeout; _passedCacheLocation = passedLocation; _passedContextCache = passedContext; _passedVolatileCache = passedVolatile; _passedLongTermCache = passedLongTerm; })); }
public void SetUp() { _cacheKey = new DefaultCacheKeyConverter().ConvertCacheKey<CachedData, string>("", _lookupKey); _contextCache = null; _response = null; _cachedItem = new CachedData(); _previousMetrics = BlendedCacheMetricsStore.GetCachedItemMetrics<CachedData, string>(_lookupKey) ?? new Metrics(); }
public void SetUp() { _cacheKey = new DefaultCacheKeyConverter().ConvertCacheKey<CachedData, string>("", _lookupKey); _response = null; _contextCachedItem = new CachedData(); _volatileCachedItem = new CachedData(); _longTermCachedItem = new CachedData(); _contextCache_Empty = new DictionaryContextCache(); _contextCache_Full = new DictionaryContextCache(_cacheKey, _contextCachedItem); _volatileCache_Empty = new DictionaryVolatileCache(); _volatileCache_Full = new DictionaryVolatileCache(_cacheKey, _volatileCachedItem); _longTermCache_Empty = new DictionaryLongTermCache(); _longTermCache_Full = new DictionaryLongTermCache(_cacheKey, _longTermCachedItem); }