public void Add_VelocityCacheInstanceNotNull() { string regionName1 = "default"; var velocityCacheWrapper = Proxies.Instance.VelocityCacheWrapper; try { var cacheWrapperItem = new CacheWrapperItem("key1", "key1 eklendi", new string[] { "key", "test" }) { Region = regionName1 }; velocityCacheWrapper.Save <CacheWrapperItem>("Key1", cacheWrapperItem, new TimeSpan(0, 0, 0, 10)); var cacheItem = velocityCacheWrapper.Get <CacheWrapperItem>("Key1"); velocityCacheWrapper.Save <CacheWrapperItem>("Key1", cacheWrapperItem, new TimeSpan(0, 0, 0, 20), true); cacheItem = velocityCacheWrapper.Get <CacheWrapperItem>("Key1"); Assert.NotNull(velocityCacheWrapper); } catch (Exception) { } }
public void Get_VelocityCacheInstanceNotNull() { var velocityCacheWrapper = Proxies.Instance.VelocityCacheWrapper; Assert.NotNull(velocityCacheWrapper); var cacheWrapperItem = new CacheWrapperItem("key1", "key1 eklendi", new string[] { "key", "test" }); var cacheItem = velocityCacheWrapper.Get <CacheWrapperItem>("Key1"); Assert.NotNull(cacheItem); }
public void Add_VelocityCacheInstanceNotNull_DiffrentRegions() { string regionName1 = "default"; string regionName2 = "HSBC"; var velocityCacheWrapper = Proxies.Instance.VelocityCacheWrapper; #region Region1 try { var cacheWrapperItem = new CacheWrapperItem("key1", "key1 eklendi", new string[] { "key", "test" }); velocityCacheWrapper.Save <CacheWrapperItem>("Key1", cacheWrapperItem, new TimeSpan(0, 0, 0, 10)); var cacheItem = velocityCacheWrapper.Get <CacheWrapperItem>("Key1"); velocityCacheWrapper.Save <CacheWrapperItem>("Key1", cacheWrapperItem, new TimeSpan(0, 0, 0, 20), true); cacheItem = velocityCacheWrapper.Get <CacheWrapperItem>("Key1"); Assert.NotNull(velocityCacheWrapper); } catch (Exception) { } #endregion #region Region2 try { Proxies.Instance.ReNew <ICacheWrapper>(velocityCacheWrapper.GetType(), "Velocity_WithHSBCRegion", true, regionName2); var newInstance = Proxies.Instance.Get <ICacheWrapper>("Velocity_WithHSBCRegion"); Assert.NotNull(newInstance); var cacheItem = newInstance.Get <CacheWrapperItem>("Key1"); var cacheWrapperItem = new CacheWrapperItem("key1", "key1 eklendi", new string[] { "key", "test" }); newInstance.Save <CacheWrapperItem>("Key1", cacheWrapperItem, new TimeSpan(0, 0, 0, 10)); cacheItem = newInstance.Get <CacheWrapperItem>("Key1"); newInstance.Save <CacheWrapperItem>("Key1", cacheWrapperItem, new TimeSpan(0, 0, 0, 20), true); cacheItem = newInstance.Get <CacheWrapperItem>("Key1"); } catch (Exception) { } #endregion }