private void Execute() { var cache = new BlendedCache(_contextCacheMock, _volatileCacheMock, _longTermCacheMock, _configurationMock); cache.SetService<IContextCacheLookup>(_contextCacheLookupMock); cache.SetService<IVolatileCacheLookup>(_volatileCacheLookupMock); cache.SetService<ILongTermCacheLookup>(_longTermCacheLookupMock); cache.SetService<ICacheKeyConverter>(_cacheKeyConverterMock); var cacheItemMetricLookup = RMM.GenerateStrictMock<ICachedItemMetricsLookup>(); RME.Stub(cacheItemMetricLookup, x => x.GetOrCreateCacheItemMetric<TDataMock, string>(_fixedUpCacheKey, _lookupKey)).Return(_cacheItemMetrics); cache.SetService<ICachedItemMetricsLookup>(cacheItemMetricLookup); cache.SetService<ICacheSetter>(_cacheSetterMock); if(_flushMode.HasValue) cache.SetFlushMode(_flushMode.Value); _response = cache.Get<TDataMock>(_lookupKey); }
private void Execute() { var service = new BlendedCache(_contextCacheMock, null, null, null); service.GetType().GetField(_flushModePrivateField, BindingFlags.NonPublic | BindingFlags.Instance).SetValue(service, _initialFlushMode); _response = service.SetFlushMode(_flushMode); }