示例#1
0
        public void MyTestMethod()
        {
            var key      = "key";
            var cachekey = key.BuildFullKey <datacls>();

            var fromcache = new datacls
            {
                DateTime = System.DateTime.Now
            };

            this._cacheState.PutObjectByKey(cachekey, fromcache);


            var cachefrom = this._cacheState.Get <datacls>(key);

            Assert.AreEqual(fromcache.DateTime, cachefrom.DateTime);
        }
示例#2
0
        public void MyTestMethod()
        {
            var key = "key";
            var cachekey = key.BuildFullKey<datacls>();

            var fromcache = new datacls
                                {
                                    DateTime = System.DateTime.Now
                                };

            this._cacheState.PutObjectByKey(cachekey, fromcache);


            var cachefrom = this._cacheState.Get<datacls>(key);
            Assert.AreEqual(fromcache.DateTime, cachefrom.DateTime);



        }
示例#3
0
        public void MyTestMethod_GetType_111()
        {
            var mykey = "adfasdf";
            var val   = new datacls
            {
                DateTime = System.DateTime.Now
            };

            this._cacheState.PutObjectByKey(mykey, val, System.DateTime.Now.AddSeconds(1));

            var cacheval = this._cacheState.GetObjectByKey(mykey);

            Assert.IsNotNull(cacheval);

            Thread.Sleep(1 * 1000);


            cacheval = this._cacheState.GetObjectByKey(mykey);

            Assert.IsNull(cacheval);
        }
示例#4
0
        public void MyTestMethod_GetType_abs()
        {
            var mykey = "adfasdf";
            var val   = new datacls
            {
                DateTime = System.DateTime.Now
            };

            this._cacheState.PutObjectByKey(mykey, val, new System.TimeSpan(0, 0, 1));

            var cacheval = this._cacheState.GetObjectByKey(mykey);

            Assert.IsNotNull(cacheval);

            Thread.Sleep(1 * 500);



            Thread.Sleep(1 * 500);
            cacheval = this._cacheState.GetObjectByKey(mykey);
            Assert.IsNull(cacheval);
        }
示例#5
0
        public void MyTestMethod_GetType_abs()
        {
            var mykey = "adfasdf";
            var val = new datacls
                          {
                              DateTime = System.DateTime.Now
                          };

            this._cacheState.PutObjectByKey(mykey, val, new System.TimeSpan(0, 0, 1));

            var cacheval = this._cacheState.GetObjectByKey(mykey);

            Assert.IsNotNull(cacheval);

            Thread.Sleep(1 * 500);




            Thread.Sleep(1 * 500);
            cacheval = this._cacheState.GetObjectByKey(mykey);
            Assert.IsNull(cacheval);
        }
示例#6
0
        public void MyTestMethod_GetType_111()
        {
            var mykey = "adfasdf";
            var val = new datacls
            {
                DateTime = System.DateTime.Now
            };

            this._cacheState.PutObjectByKey(mykey, val, System.DateTime.Now.AddSeconds(1));

            var cacheval = this._cacheState.GetObjectByKey(mykey);

            Assert.IsNotNull(cacheval);

            Thread.Sleep(1 * 1000);


            cacheval = this._cacheState.GetObjectByKey(mykey);

            Assert.IsNull(cacheval);
        }