1414using Xtensive . Orm . Tests . Linq . LocalCollectionsTest_Model ;
1515using Xtensive . Orm . Tests . ObjectModel ;
1616using Xtensive . Orm . Tests . ObjectModel . ChinookDO ;
17+ using System . Threading . Tasks ;
1718
1819namespace Xtensive . Orm . Tests . Linq . LocalCollectionsTest_Model
1920{
@@ -253,7 +254,7 @@ public void Pair2Test()
253254 [ Test ]
254255 public void Poco1Test ( )
255256 {
256- Assert . Throws < QueryTranslationException > ( ( ) => {
257+ _ = Assert . Throws < QueryTranslationException > ( ( ) => {
257258 var pocos = Customers
258259 . Select ( customer => new Poco < string > ( ) { Value = customer . LastName } )
259260 . ToList ( ) ;
@@ -357,7 +358,7 @@ public void TypeLoop1Test()
357358 var nodes = new Node [ 10 ] ;
358359 var query = Session . Query . All < Invoice > ( )
359360 . Join ( nodes , invoice => invoice . Customer . Address . City , node => node . Name , ( invoice , node ) => new { invoice , node } ) ;
360- Assert . Throws < QueryTranslationException > ( ( ) => QueryDumper . Dump ( query ) ) ;
361+ _ = Assert . Throws < QueryTranslationException > ( ( ) => QueryDumper . Dump ( query ) ) ;
361362 }
362363
363364 [ Test ]
@@ -403,7 +404,7 @@ public void AllTest()
403404 [ Test ]
404405 public void KeyTest ( )
405406 {
406- Assert . Throws < QueryTranslationException > ( ( ) => {
407+ _ = Assert . Throws < QueryTranslationException > ( ( ) => {
407408 var keys = Session . Query . All < Invoice > ( ) . Take ( 10 ) . Select ( invoice => invoice . Key ) . ToList ( ) ;
408409 var query = Session . Query . All < Invoice > ( )
409410 . Join ( keys , invoice => invoice . Key , key => key , ( invoice , key ) => new { invoice , key } ) ;
@@ -863,7 +864,6 @@ public void Aggregate1Test()
863864 Assert . AreEqual ( result , expected ) ;
864865 }
865866
866-
867867 [ Test ]
868868 public void Aggregate2Test ( )
869869 {
@@ -881,10 +881,27 @@ public void Aggregate2Test()
881881 QueryDumper . Dump ( result ) ;
882882 }
883883
884+ [ Test ]
885+ public async Task Aggregate2AsyncTest ( )
886+ {
887+ Require . AllFeaturesSupported ( ProviderFeatures . TemporaryTables ) ;
888+ Require . ProviderIsNot ( StorageProvider . SqlServerCe ) ;
889+ var localItems = GetLocalItems ( 100 ) ;
890+ var queryable = Session . Query . Store ( localItems ) ;
891+ var result = ( await Session . Query . All < Invoice > ( )
892+ . Where ( invoice => invoice . Commission > queryable . Max ( poco => poco . Value2 ) ) . AsAsync ( ) ) . ToList ( ) ;
893+ var expected = Invoices
894+ . Where ( invoice => invoice . Commission > localItems . Max ( poco => poco . Value2 ) ) ;
895+
896+ Assert . That ( result , Is . Not . Empty ) ;
897+ Assert . AreEqual ( 0 , expected . Except ( result ) . Count ( ) ) ;
898+ QueryDumper . Dump ( result ) ;
899+ }
900+
884901 [ Test ]
885902 public void ClosureCacheTest ( )
886903 {
887- Assert . Throws < QueryTranslationException > ( ( ) => {
904+ _ = Assert . Throws < QueryTranslationException > ( ( ) => {
888905 var localItems = GetLocalItems ( 100 ) ;
889906 var queryable = Session . Query . Store ( localItems ) ;
890907 var result = Session . Query . Execute ( qe => qe . All < Invoice > ( ) . Where ( invoice => invoice . Commission > queryable . Max ( poco => poco . Value2 ) ) ) ;
0 commit comments