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());

            LengthTokenFilter filter = new LengthTokenFilter(filterDict.First().Key);
            TokenFilterBase.Deserialize(filter, fieldDict);
            filter.Maximum = fieldDict.GetInt32(_MAXIMUM, LengthTokenFilter._MAXIMUM_DEFAULT);
            filter.Minimum = fieldDict.GetInt32(_MINIMUM, LengthTokenFilter._MINIMUM_DEFAULT);

            return filter;
        }
        public void PASS_Create()
        {
            LengthTokenFilter filter = new LengthTokenFilter("name")
            {
                Minimum = 1,
                Maximum = 13
            };

            Assert.IsNotNull(filter);
            Assert.AreEqual("name", filter.Name);
            Assert.AreEqual((int)1, filter.Minimum);
            Assert.AreEqual((int)13, filter.Maximum);
        }
        public void PASS_Serialize()
        {
            LengthTokenFilter filter = new LengthTokenFilter("name")
            {
                Minimum = 1,
                Maximum = 13
            };

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

            string expectedJson = "{\"name\":{\"type\":\"length\",\"min\":1,\"max\":13}}";
            Assert.AreEqual(expectedJson, json);
        }