public void Setup() { _services = new ServiceCollection() .AddDistributedMemoryCache() .Configure <DistributedCacheStorageOptions>(_ => { }) .BuildServiceProvider(); var memoryCache = _services.GetRequiredService <IDistributedCache>(); var options = _services.GetRequiredService <IOptions <DistributedCacheStorageOptions> >(); _storage = new DistributedCacheStorage(memoryCache, options); }