public void TestSort() { var s = new SearchDescriptor <ElasticSearchProject>() .From(0) .Size(10) .Sort(sort => sort .OnField(e => e.Name) .MissingLast() .Descending() ); var json = TestElasticClient.Serialize(s); var expected = @" { from: 0, size: 10, sort: { name: { missing: ""_last"", order: ""desc"" } } }" ; Assert.True(json.JsonEquals(expected), json); }
protected void JsonNotEquals(object o, MethodBase method, string fileName = null) { var json = TestElasticClient.Serialize(o); this.JsonNotEquals(json, method, fileName); }