@@ -386,5 +386,45 @@ public void TestMultipleOrderBys()
386
386
_ = collection . OrderBy ( x => x . RecordShell . Name ) . OrderByDescending ( x => x . RecordShell . Age ) . ToList ( ) ;
387
387
_mock . Verify ( x=> x . Execute ( "FT.AGGREGATE" , "person-idx" , "*" , "SORTBY" , "4" , "@Name" , "ASC" , "@Age" , "DESC" , "WITHCURSOR" , "COUNT" , "10000" ) ) ;
388
388
}
389
+
390
+ [ Fact ]
391
+ public void TestNestedOrderBy ( )
392
+ {
393
+ var collection = new RedisAggregationSet < Person > ( _mock . Object , true , chunkSize : 10000 ) ;
394
+ _mock . Setup ( x => x . Execute ( "FT.AGGREGATE" , It . IsAny < string [ ] > ( ) ) ) . Returns ( MockedResult ) ;
395
+ _mock . Setup ( x => x . Execute ( "FT.CURSOR" , It . IsAny < string [ ] > ( ) ) ) . Returns ( MockedResultCursorEnd ) ;
396
+ _ = collection . OrderBy ( x => x . RecordShell . Address . State ) . ToList ( ) ;
397
+ _mock . Verify ( x=> x . Execute ( "FT.AGGREGATE" , "person-idx" , "*" , "SORTBY" , "2" , "@Address_State" , "ASC" , "WITHCURSOR" , "COUNT" , "10000" ) ) ;
398
+ }
399
+
400
+ [ Fact ]
401
+ public void TestNestedGroup ( )
402
+ {
403
+ var collection = new RedisAggregationSet < Person > ( _mock . Object , true , chunkSize : 10000 ) ;
404
+ _mock . Setup ( x => x . Execute ( "FT.AGGREGATE" , It . IsAny < string [ ] > ( ) ) ) . Returns ( MockedResult ) ;
405
+ _mock . Setup ( x => x . Execute ( "FT.CURSOR" , It . IsAny < string [ ] > ( ) ) ) . Returns ( MockedResultCursorEnd ) ;
406
+ _ = collection . GroupBy ( x => x . RecordShell . Address . State ) . ToList ( ) ;
407
+ _mock . Verify ( x=> x . Execute ( "FT.AGGREGATE" , "person-idx" , "*" , "GROUPBY" , "1" , "@Address_State" , "WITHCURSOR" , "COUNT" , "10000" ) ) ;
408
+ }
409
+
410
+ [ Fact ]
411
+ public void TestNestedGroupMulti ( )
412
+ {
413
+ var collection = new RedisAggregationSet < Person > ( _mock . Object , true , chunkSize : 10000 ) ;
414
+ _mock . Setup ( x => x . Execute ( "FT.AGGREGATE" , It . IsAny < string [ ] > ( ) ) ) . Returns ( MockedResult ) ;
415
+ _mock . Setup ( x => x . Execute ( "FT.CURSOR" , It . IsAny < string [ ] > ( ) ) ) . Returns ( MockedResultCursorEnd ) ;
416
+ _ = collection . GroupBy ( x => new { x . RecordShell . Address . State , x . RecordShell . Address . ForwardingAddress . City } ) . ToList ( ) ;
417
+ _mock . Verify ( x=> x . Execute ( "FT.AGGREGATE" , "person-idx" , "*" , "GROUPBY" , "2" , "@Address_State" , "@Address_ForwardingAddress_City" , "WITHCURSOR" , "COUNT" , "10000" ) ) ;
418
+ }
419
+
420
+ [ Fact ]
421
+ public void TestNestedApply ( )
422
+ {
423
+ var collection = new RedisAggregationSet < Person > ( _mock . Object , true , chunkSize : 10000 ) ;
424
+ _mock . Setup ( x => x . Execute ( "FT.AGGREGATE" , It . IsAny < string [ ] > ( ) ) ) . Returns ( MockedResult ) ;
425
+ _mock . Setup ( x => x . Execute ( "FT.CURSOR" , It . IsAny < string [ ] > ( ) ) ) . Returns ( MockedResultCursorEnd ) ;
426
+ _ = collection . Apply ( x => x . RecordShell . Address . HouseNumber + 4 , "house_num_modified" ) . ToList ( ) ;
427
+ _mock . Verify ( x=> x . Execute ( "FT.AGGREGATE" , "person-idx" , "*" , "APPLY" , "@Address_HouseNumber + 4" , "AS" , "house_num_modified" , "WITHCURSOR" , "COUNT" , "10000" ) ) ;
428
+ }
389
429
}
390
430
}
0 commit comments