public void Export_Omits_Field_If_Not_Provided() { var query = new MatchPhraseQuery("phrase"); var expected = JsonConvert.SerializeObject(new { match_phrase = "phrase", }, Formatting.None); Assert.Equal(expected, query.Export().ToString(Formatting.None)); }
public void Export_Returns_Valid_Json() { var query = new MatchPhraseQuery("phrase") .Field("field"); var expected = JsonConvert.SerializeObject(new { match_phrase = "phrase", field = "field" }, Formatting.None); Assert.Equal(expected, query.Export().ToString(Formatting.None)); }