public void ConfigureNewSearchRouteTestNewConfig()
        {
            InfinityEngine.Services.InfinityEngineService infinityEngineService = new InfinityEngine.Services.InfinityEngineService();
            Configuration config = new Configuration();
            config.AutoCompleteRoute = "testRoute";
            config.MaxResults = 100;
            config.RecordIndentifier = "id";
            config.UpdateURL = "http://localhost:8124/names";

            infinityEngineService.ConfigureSearchRoute(config);

            BasicRedisClientManager pooledClientManager = RedisClientManager.get();
            using (IRedisClient redisClient = pooledClientManager.GetClient())
            {
                IRedisTypedClient<Configuration> redis = redisClient.As<Configuration>();
                Configuration redisConfig = redisClient.Get<Configuration>(config.AutoCompleteRoute);
                Assert.IsTrue(redisConfig.AutoCompleteRoute.Equals(config.AutoCompleteRoute));
            }
        }
        public void SearchTheRouteTest()
        {
            Configuration config = new Configuration();
            config.AutoCompleteRoute = "testRoute";
            config.MaxResults = 100;
            config.RecordIndentifier = "Code";
            config.UpdateURL = "http://urltoupdatefrom";

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

                Dictionary<string, string> dataObj = new Dictionary<string, string>();
                dataObj["Code"] = "foo";
                dataObj["Desc"] = "bar";
                redisClient.Lists["cacheIndex:" + config.AutoCompleteRoute].Add(dataObj[config.RecordIndentifier]);
                redisClient.SetEntry("fullCache:" + config.AutoCompleteRoute + ":" + dataObj[config.RecordIndentifier], JsonConvert.SerializeObject(dataObj));

                redisClient.AddItemToSortedSet(config.AutoCompleteRoute + ":autocomplete:b", "foo", 0);
                redisClient.AddItemToSortedSet(config.AutoCompleteRoute + ":autocomplete:ba", "foo", 0);
                redisClient.AddItemToSortedSet(config.AutoCompleteRoute + ":autocomplete:bar", "foo", 0);
                redisClient.AddItemToSortedSet(config.AutoCompleteRoute + ":autocomplete:bar*", "foo", 0);
            }

            InfinityEngine.Services.InfinityEngineService infinityEngineService = new InfinityEngine.Services.InfinityEngineService();
            string resultString = infinityEngineService.SearchTheRoute(config.AutoCompleteRoute, "ba");
            List<Dictionary<string, string>> results = JsonConvert.DeserializeObject <List<Dictionary<string, string>>>(resultString);

            if (results.Count > 0)
            {
                Dictionary<string, string> firstResult = results[0];
                Assert.IsTrue(firstResult["Code"].Equals("foo") &&
                              firstResult["Desc"].Equals("bar"));
            }
            else
            {
                Assert.IsTrue(false);
            }
        }
        public void UpdateSearchRouteAllTest()
        {
            InfinityEngine.Services.InfinityEngineService infinityEngineService = new InfinityEngine.Services.InfinityEngineService();
            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);
            }

            infinityEngineService.UpdateSearchRouteAll(config.AutoCompleteRoute);

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