public FibonacciNumbers(IFibonacciCache fibonacciCache) { if (fibonacciCache == null) { throw new ArgumentNullException(nameof(fibonacciCache)); } this.cache = fibonacciCache; }
public FibonacciSequence(int count, IFibonacciCache cache) { if (count <= 0) { throw new ArgumentOutOfRangeException(nameof(count), "Count should be greater than zero."); } _count = count; _cache = cache; }
public FibonacciSequence(IFibonacciFactory fibonacciFactory, IFibonacciCache fibonacciCache) { this.fibonacciFactory = fibonacciFactory ?? throw new ArgumentNullException(nameof(fibonacciFactory)); this.fibonacciCache = fibonacciCache ?? throw new ArgumentNullException(nameof(fibonacciCache)); }
public FibonacciSolver(IFibonacciCache cache) { _cache = cache; }
public void Cleanup() { cacheService = null; }
public void Initialize() { cacheService = new RuntimeCaching(); fibonacciFactory = new FibonacciFactory(); }
public FibonacciService(IFibonacciCache cache, bool isCacheEnabled) { _cache = cache; _isCacheEnabled = isCacheEnabled; }
private static void FeedData(IFibonacciCache cache) { cache.Save(0, 1); cache.Save(1, 90); cache.Save(-10, 33); }