public SlidingWindowCacheTest() { _config = new SlidingWindowConfig <double> { PerLoadSize = 0.61, StartPoint = 11.1, EndPoint = 689.7, TotalLoadSize = 12, TotalCacheSize = 65.6 }; var rd = new Random(); _cache = new SlidingWindowCache <double, double>(_config) { DataSourceDelegate = (a, b, c) => { return(Task.FromResult <IEnumerable <double> >( Enumerable.Range(0, (int)(b - a)) .Select(t => rd.NextDouble()) .ToList() )); }, CurrentPoint = _config.StartPoint }; }
public Int32CacheKeyTests() { _windowConfig = new SlidingWindowConfig <int> { StartPoint = 9, EndPoint = 65, PerLoadSize = 7 }; _keyHelper = new CacheKeyHelper <int>(_windowConfig); }
public DoubleCacheKeyTests() { _windowConfig = new SlidingWindowConfig <double> { StartPoint = 9.7, EndPoint = 65.3, PerLoadSize = 7.411 }; _keyHelper = new CacheKeyHelper <double>(_windowConfig); }
public CacheKeyHelper(ISlidingWindowConfig <TKey> config) { _config = config; _calculator = CalculatorFactory.Build <TKey>(); }