public ConcurrentDictionaryPostIndexCache(TimeSpan cacheDuration)
        {
            if (cacheDuration.Ticks <= 0)
            {
                throw new ArgumentOutOfRangeException(nameof(cacheDuration), "cacheDuration must be > 0");
            }

            _cache = new ConcurrentDictionaryCache(cacheDuration);
        }
Beispiel #2
0
        public void Constructor_CacheInjection_SetsInternalCacheReferences()
        {
            var serCache   = new ConcurrentDictionaryCache <Tuple <string>, string>();
            var deSerCache = new ConcurrentDictionaryCache <string, Tuple <string> >();

            var ser = new TupleSerializer <Tuple <string> >(serCache, deSerCache);

            Assert.Equal(ser._serializationCache, serCache);
            Assert.Equal(ser._deserializationCache, deSerCache);
        }
 public void DefaultConstructor_DoesNotReturnNull()
 {
     var cache = new ConcurrentDictionaryCache<string, string>();
     Assert.NotNull(cache);
 }
        public void Constructor_CacheInjection_SetsInternalCacheReferences()
        {
            var serCache = new ConcurrentDictionaryCache<Tuple<string>, string>();
            var deSerCache = new ConcurrentDictionaryCache<string, Tuple<string>>();

            var ser = new TupleSerializer<Tuple<string>>(serCache, deSerCache);

            Assert.Equal(ser._serializationCache, serCache);
            Assert.Equal(ser._deserializationCache, deSerCache);
        }
 public ConcurrentDictionaryCacheTests()
 {
     _sut = new ConcurrentDictionaryCache <string, object>();
 }
        public void DefaultConstructor_DoesNotReturnNull()
        {
            var cache = new ConcurrentDictionaryCache <string, string>();

            Assert.NotNull(cache);
        }