public void PASS_Serialize()
        {
            StopTokenFilter filter = new StopTokenFilter("name")
            {
                Version = 2.4,
                IgnoreCase = true,
                RemoveTrailing = false,
                Stopwords = new List<string>() { "stop1", "stop2" },
                StopwordsPath = "stopword/path"
            };

            string json = JsonConvert.SerializeObject(filter);
            Assert.IsNotNull(json);

            string expectedJson = "{\"name\":{\"type\":\"stop\",\"version\":2.4,\"stopwords\":[\"stop1\",\"stop2\"],\"stopwords_path\":\"stopword/path\",\"ignore_case\":true,\"remove_trailing\":false}}";
            Assert.AreEqual(expectedJson, json);
        }
        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
        {
            Dictionary<string, object> filterDict = serializer.Deserialize<Dictionary<string, object>>(reader);
            Dictionary<string, object> fieldDict = JsonConvert.DeserializeObject<Dictionary<string, object>>(filterDict.First().Value.ToString());

            StopTokenFilter filter = new StopTokenFilter(filterDict.First().Key);
            TokenFilterBase.Deserialize(filter, fieldDict);
            filter.IgnoreCase = fieldDict.GetBool(_IGNORE_CASE, StopTokenFilter._IGNORE_CASE_DEFAULT);
            filter.RemoveTrailing = fieldDict.GetBool(_REMOVE_TRAILING, StopTokenFilter._REMOVE_TRAILING_DEFAULT);

            if (fieldDict.ContainsKey(_STOPWORDS))
            {
                filter.Stopwords = JsonConvert.DeserializeObject<IEnumerable<string>>(fieldDict.GetString(_STOPWORDS));
            }

            filter.StopwordsPath = fieldDict.GetStringOrDefault(_STOPWORDS_PATH);

            return filter;
        }
        public void PASS_Create()
        {
            StopTokenFilter filter = new StopTokenFilter("name")
            {
                Version = 2.4,
                IgnoreCase = true,
                RemoveTrailing = false,
                Stopwords = new List<string>() { "stop1", "stop2" },
                StopwordsPath = "stopword/path"
            };

            Assert.IsNotNull(filter);
            Assert.AreEqual("name", filter.Name);
            Assert.AreEqual(2.4, filter.Version);
            Assert.AreEqual(true, filter.IgnoreCase);
            Assert.AreEqual(false, filter.RemoveTrailing);
            Assert.AreEqual("stop1", filter.Stopwords.First());
            Assert.AreEqual("stop2", filter.Stopwords.Last());
            Assert.AreEqual("stopword/path", filter.StopwordsPath);
        }