I have a generic method as shown below,
public interface IMemoryCacheWithPolicy
{
TItem GetOrCreate<TItem>(object key, Func<TItem> createItem, CacheItemPriority priorityLevel);
}
I am calling the method like,
var materials = _cacheProvider.GetOrCreate("ActiveMaterials",
() => _materialService.GetMaterials(false), CacheItemPriority.Normal);
To unit test the calling class, How can i setup MOQ of IMemoryCacheWithPolicy, Tried few of the suggestion provided in other threads, But could not get it to work.