Export() public method

public Export ( ) : Newtonsoft.Json.Linq.JObject
return Newtonsoft.Json.Linq.JObject
        public void Export_Omits_Field_If_Not_Provided()
        {
            var query = new TermQuery("theterm")
                .PrefixLength(5)
                .Fuzziness(1);

            var expected = JsonConvert.SerializeObject(new
            {
                term = "theterm",
                prefix_length = 5,
                fuzziness = 1
            }, Formatting.None);

            Assert.AreEqual(expected, query.Export().ToString(Formatting.None));
        }
        public void Export_ReturnsValidJson()
        {
            var query = new TermQuery("theterm")
                .Field("field")
                .PrefixLength(5)
                .Fuzziness(1);

            var expected = JsonConvert.SerializeObject(new
            {
                term = "theterm",
                prefix_length = 5,
                fuzziness = 1,
                field = "field"
            }, Formatting.None);

            Assert.AreEqual(expected, query.Export().ToString(Formatting.None));
        }