public void TestSynchFromRedis()
        {
            var testClass = new UnitTestClass()
            {
                TestDescription = "TestSynchFromRedis",
                TestId          = 4
            };

            var persistenceCacheStackEntity = new PersistenceCacheStackEntity("TestSynchFromRedis", testClass, null);

            var redisWrapper = new RedisWrapper();

            // add fake object into Redis
            var addResult = redisWrapper.Push(persistenceCacheStackEntity);

            Assert.IsTrue(addResult);

            var objectCached = redisWrapper.Get(persistenceCacheStackEntity.Key);

            Assert.IsNotNull(objectCached);

            // synch from Redis
            var persistenceCacheStack = new PersistenceCacheStackClient <UnitTestClass>(true);

            var obj = persistenceCacheStack.GetItem("TestSynchFromRedis");

            Assert.IsNotNull(obj);
            Assert.IsTrue(obj.TestId == 4);
        }
Пример #2
0
        public void TestGetItem()
        {
            var persistenceCacheStackEntity = new PersistenceCacheStackEntity("test", new object(), null);

            var redisWrapper = new RedisWrapper();

            var addResult = redisWrapper.Push(persistenceCacheStackEntity);

            Assert.IsTrue(addResult);

            var objectCached = redisWrapper.Get(persistenceCacheStackEntity.Key);

            Assert.IsNotNull(objectCached);
        }