public void Setup()
 {
     _cacheStore = Substitute.For<ICacheStore>();
     _cacheStore.StoreId.Returns(10);
     _adaptor = new CacheStoreAdaptor(_cacheStore);
     Assert.AreEqual(10, _adaptor.StoreId);
 }
Exemplo n.º 2
0
 public void Setup()
 {
     _cacheStore = Substitute.For <ICacheStore>();
     _cacheStore.StoreId.Returns(10);
     _adaptor = new CacheStoreAdaptor(_cacheStore);
     Assert.AreEqual(10, _adaptor.StoreId);
 }
        /// <summary>
        /// Initializes a DefaultCacheStoreProvider with default <see cref="ICacheStore" /> and <see cref="IAsyncCacheStore" />
        /// </summary>
        public DefaultCacheStoreProvider()
        {
            var objectStore = new ObjectCacheStore();
            _cacheStore[0] = objectStore;
            _cacheStoreTypes[typeof(ICacheStore)] = objectStore;
            _cacheStoreTypes[typeof(ObjectCacheStore)] = objectStore;

            var adaptor = new CacheStoreAdaptor(objectStore);
            _asyncCacheStore[0] = adaptor;
            _cacheStoreTypes[typeof(IAsyncCacheStore)] = adaptor;
        }
Exemplo n.º 4
0
        /// <summary>
        /// Initializes a DefaultCacheStoreProvider with default <see cref="ICacheStore" /> and <see cref="IAsyncCacheStore" />
        /// </summary>
        public DefaultCacheStoreProvider()
        {
            var objectStore = new ObjectCacheStore();

            _cacheStore[0] = objectStore;
            _cacheStoreTypes[typeof(ICacheStore)]      = objectStore;
            _cacheStoreTypes[typeof(ObjectCacheStore)] = objectStore;

            var adaptor = new CacheStoreAdaptor(objectStore);

            _asyncCacheStore[0] = adaptor;
            _cacheStoreTypes[typeof(IAsyncCacheStore)] = adaptor;
        }