public void CustomMemoryCache_AddOrGetExistingCacheAdd() { var policy = new CacheItemPolicy { SlidingExpiration = new TimeSpan(0, 10, 0) }; var addCache = _customMemoryCache.AddOrGetExisting(Key, Value, policy); Assert.IsNull(addCache); var getCacheValue = _customMemoryCache.AddOrGetExisting(Key, Value, policy); Assert.IsNotNull(getCacheValue); Assert.AreEqual(Value, getCacheValue); }