我无法在单元测试中使用Set在 ObjectCache 中插入缓存条目。
var objectCache = Substitute.For<ObjectCache>();
objectCache.Set("TestKey", object, Arg.Any<DateTimeOffset>());
当我进入我的代码时
var cachedData = _objectCache.Get("TestKey");
// cachedData is null
我正在使用 Nsubstitute 来模拟库。
有谁知道如何克服这个问题?