public bool UpdateSearchRoute(string routeName, string updateKey)
 {
     bool success = false;
     InfinityEngine.Business.InfinityEngine infinityEngine = new InfinityEngine.Business.InfinityEngine();
     success = infinityEngine.UpdateFullCache(routeName, updateKey);
     if (success)
     {
         success = false;
         infinityEngine.UpdateAutoCompleteCache(routeName);
         success = true;
     }
     return success;
 }
        public void TestUpdateFullCachePartial()
        {
            Configuration config = new Configuration();
            config.AutoCompleteRoute = "testRoute";
            config.MaxResults = 100;
            config.RecordIndentifier = "id";
            config.UpdateURL = "http://localhost:8124/names";

            BasicRedisClientManager pooledClientManager = RedisClientManager.get();
            using (IRedisClient redisClient = pooledClientManager.GetClient())
            {
                IRedisTypedClient<Configuration> redis = redisClient.As<Configuration>();
                redis.SetEntry(config.AutoCompleteRoute, config);
            }

            InfinityEngine.Business.InfinityEngine infinityEngine = new InfinityEngine.Business.InfinityEngine();
            infinityEngine.UpdateFullCache(config.AutoCompleteRoute);
            infinityEngine.UpdateFullCache(config.AutoCompleteRoute, "stephen");

            using (IRedisClient redisClient = pooledClientManager.GetClient())
            {
                string data = redisClient.GetValue("fullCache:" + config.AutoCompleteRoute + ":567");
                Dictionary<string, string> dataDic = JsonConvert.DeserializeObject<Dictionary<string, string>>(data);
                Assert.IsTrue(dataDic["lastname"].Equals("smith"));
            }
        }
        public void TestUpdateFullCacheAll()
        {
            Configuration config = new Configuration();
            config.AutoCompleteRoute = "testRoute";
            config.MaxResults = 100;
            config.RecordIndentifier = "id";
            config.UpdateURL = "http://localhost:8124/names";

            BasicRedisClientManager pooledClientManager = RedisClientManager.get();
            using (IRedisClient redisClient = pooledClientManager.GetClient())
            {
                IRedisTypedClient<Configuration> redis = redisClient.As<Configuration>();
                redis.SetEntry(config.AutoCompleteRoute, config);
            }

            InfinityEngine.Business.InfinityEngine infinityEngine = new InfinityEngine.Business.InfinityEngine();
            infinityEngine.UpdateFullCache(config.AutoCompleteRoute);

            using (IRedisClient redisClient = pooledClientManager.GetClient())
            {
                string data = redisClient.GetValue("fullCache:" + config.AutoCompleteRoute + ":123");
                Assert.IsNotNull(data);
            }
        }