public void SetUp() { _response = null; _lookupKey = "my lookupKey"; _fixedUpCacheKey = "cache key for: " + _lookupKey; _flushMode = null; _cacheTimeout = RMM.GenerateMock<ICacheTimeout>(); _configurationMock = RMM.GenerateMock<IBlendedCacheConfiguration>(); RME.Stub(_configurationMock, x => x.GetCacheTimeoutForTypeOrDefault(typeof(TDataMock))).Return(_cacheTimeout); _cacheItemMetrics = new CachedItemMetrics(_lookupKey, _fixedUpCacheKey); _cacheKeyConverterMock = RMM.GenerateStrictMock<ICacheKeyConverter>(); RME.Stub(_cacheKeyConverterMock, x => x.ConvertCacheKey<TDataMock, string>(null, _lookupKey)).Do(new Func<string, string, string>((a, b) => _fixedUpCacheKey)); _contextCachedObject = null; _contextCacheLookupMock = RMM.GenerateStrictMock<IContextCacheLookup>(); RME.Stub(_contextCacheLookupMock, x => x.GetDataFromContextCache<TDataMock>(_fixedUpCacheKey)).Do(new Func<string, TDataMock>((a) => _contextCachedObject)); _volatileCachedObject = null; _volatileCacheLookupMock = RMM.GenerateStrictMock<IVolatileCacheLookup>(); RME.Stub(_volatileCacheLookupMock, x=>x.GetDataFromVolatileCache<TDataMock>(_fixedUpCacheKey, _cacheItemMetrics)).Do(new Func<string, CachedItemMetrics, TDataMock>((a, b) => _volatileCachedObject)); _longTermCachedObject = null; _longTermCacheLookupMock = RMM.GenerateStrictMock<ILongTermCacheLookup>(); RME.Stub(_longTermCacheLookupMock, x => x.GetDataFromLongTermCache<TDataMock>(_fixedUpCacheKey, _cacheItemMetrics)).Do(new Func<string, CachedItemMetrics, TDataMock>((a, b) => _longTermCachedObject)); _cacheSetterMock = RMM.GenerateMock<ICacheSetter>(); _contextCacheMock = RMM.GenerateMock<IContextCache>(); _volatileCacheMock = RMM.GenerateMock<IVolatileCache>(); _longTermCacheMock = RMM.GenerateMock<ILongTermCache>(); }
public void SetUp() { _flushed = false; _ticksStart = 3234234; _ticksEnd = _ticksStart + 10000; _metrics = new CachedItemMetrics("", new object()); }
public void SetUp() { _itemLookedUp = null; _metrics = new CachedItemMetrics("", new object()); _updaterMock = RMM.GenerateStrictMock<IWebRequestCacheMetricsUpdater>(); RME.Stub(_updaterMock, x => x.Increment_Cache_LongTermLookup()); RME.Stub(_updaterMock, x => x.Increment_Cache_LongTermHits()); RME.Stub(_updaterMock, x => x.Increment_Cache_LongTermMisses()); }
public void SetUp() { _private = new CachedItemMetrics("mycustomkey", new object()); }
public void SetUp() { _ticksStart = 38724234; _ticksEnd = _ticksStart + 10000; _metrics = new CachedItemMetrics("", new object()); }