I have a working implementation of Azure Redis and .Net Core 2 using code very similar to what's described in this article
My question is, how do you instantiate an instance of the cache from a unit test class? I've looked through a number of resources and found nothing.
I need to be able to create an instance to instantiate a class such as
public CacheManager(IDataManager dataservices, IDistributedCache cache)
{
_cache = cache;
_dataservices = dataservices;
}
The code in startup.cs uses ConfigureServices
//Configure Redis Cache
var redisconnection = Configuration.GetConnectionString("Redis");
services.AddDistributedRedisCache(o => { o.Configuration = redisconnection; });
Maybe I need to add a package to the unit test project? How is this done?