コード例 #1
0
        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);
        }
コード例 #2
0
        protected void JsonNotEquals(object o, MethodBase method, string fileName = null)
        {
            var json = TestElasticClient.Serialize(o);

            this.JsonNotEquals(json, method, fileName);
        }