public void ExecuteShouldReturnExpectedValue(Scenario scenario)
        {
            var filter = new LowercaseTokenFilter();
            var result = filter.Execute(scenario.Input, scenario.AnalyzeContext);

            Assert.Equal(scenario.ExpectedResult, result);
        }
        public void PASS_Create()
        {
            LowercaseTokenFilter filter = new LowercaseTokenFilter("name")
            {
                Language = LowercaseSupportedLanguageEnum.Greek
            };

            Assert.IsNotNull(filter);
            Assert.AreEqual("name", filter.Name);
            Assert.AreEqual(LowercaseSupportedLanguageEnum.Greek, filter.Language);
        }
        public void PASS_Serialize()
        {
            LowercaseTokenFilter filter = new LowercaseTokenFilter("name")
            {
                Language = LowercaseSupportedLanguageEnum.Greek
            };

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

            string expectedJson = "{\"name\":{\"type\":\"lowercase\",\"language\":\"Greek\"}}";
            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());

            LowercaseTokenFilter filter = new LowercaseTokenFilter(filterDict.First().Key);
            TokenFilterBase.Deserialize(filter, fieldDict);

            LowercaseSupportedLanguageEnum lowercaseLanguage = LowercaseSupportedLanguageEnum.Greek;
            filter.Language = LowercaseSupportedLanguageEnum.Find(fieldDict.GetString(_LANGUAGE));

            return filter;
        }