@@ -595,22 +595,33 @@ public void GroupByKeyWithConstantFromVariable()
595595 {
596596 constKey = 1 ;
597597 var q1 = db . Orders . GroupBy ( o => constKey ) . Select ( g => new { Key = g . Key , Count = g . Count ( ) , Sum = g . Sum ( x => x . Freight ) } ) ;
598+ var q1a = db . Orders . GroupBy ( o => "" ) . Select ( g => new { Key = g . Key , Count = g . Count ( ) , Sum = g . Sum ( x => x . Freight ) } ) ;
598599 var q2 = db . Orders . GroupBy ( o => new { A = constKey } ) . Select ( g => new { Key = g . Key , Count = g . Count ( ) , Sum = g . Sum ( x => x . Freight ) } ) ;
599600 var q3 = db . Orders . GroupBy ( o => new object [ ] { constKey } ) . Select ( g => new { Key = g . Key , Count = g . Count ( ) , Sum = g . Sum ( x => x . Freight ) } ) ;
601+ var q3a = db . Orders . GroupBy ( o => ( IEnumerable < object > ) new object [ ] { constKey } ) . Select ( g => new { Key = g . Key , Count = g . Count ( ) , Sum = g . Sum ( x => x . Freight ) } ) ;
600602 var q4 = db . Orders . GroupBy ( o => new { A = constKey , B = o . Shipper . ShipperId } ) . Select ( g => new { Key = g . Key , Count = g . Count ( ) , Sum = g . Sum ( x => x . Freight ) } ) ;
601603 var q5 = db . Orders . GroupBy ( o => new [ ] { constKey , o . Shipper . ShipperId } ) . Select ( g => new { Key = g . Key , Count = g . Count ( ) , Sum = g . Sum ( x => x . Freight ) } ) ;
604+ var q5a = db . Orders . GroupBy ( o => ( IEnumerable < int > ) new [ ] { constKey , o . Shipper . ShipperId } ) . Select ( g => new { Key = g . Key , Count = g . Count ( ) , Sum = g . Sum ( x => x . Freight ) } ) ;
602605
603606 var r1_1 = q1 . ToList ( ) ;
604607 Assert . That ( r1_1 . Count , Is . EqualTo ( 1 ) ) ;
605608 Assert . That ( r1_1 , Has . All . With . Property ( "Key" ) . EqualTo ( 1 ) ) ;
606609
610+ var r1a_1 = q1a . ToList ( ) ;
611+ Assert . That ( r1a_1 . Count , Is . EqualTo ( 1 ) ) ;
612+ Assert . That ( r1a_1 , Has . All . With . Property ( "Key" ) . EqualTo ( "" ) ) ;
613+
607614 var r2_1 = q2 . ToList ( ) ;
608615 Assert . That ( r2_1 . Count , Is . EqualTo ( 1 ) ) ;
609616 Assert . That ( r2_1 , Has . All . With . Property ( "Key" ) . With . Property ( "A" ) . EqualTo ( 1 ) ) ;
610617
611618 var r3_1 = q3 . ToList ( ) ;
612619 Assert . That ( r3_1 . Count , Is . EqualTo ( 1 ) ) ;
613- Assert . That ( r3_1 , Has . All . With . Property ( "Key" ) . EqualTo ( new object [ ] { 1 } ) ) ;
620+ Assert . That ( r3_1 , Has . All . With . Property ( "Key" ) . EquivalentTo ( new object [ ] { 1 } ) ) ;
621+
622+ var r3a_1 = q3a . ToList ( ) ;
623+ Assert . That ( r3a_1 . Count , Is . EqualTo ( 1 ) ) ;
624+ Assert . That ( r3a_1 , Has . All . With . Property ( "Key" ) . EquivalentTo ( new object [ ] { 1 } ) ) ;
614625
615626 var r4_1 = q4 . ToList ( ) ;
616627 Assert . That ( r4_1 . Count , Is . EqualTo ( 3 ) ) ;
@@ -620,6 +631,10 @@ public void GroupByKeyWithConstantFromVariable()
620631 Assert . That ( r5_1 . Count , Is . EqualTo ( 3 ) ) ;
621632 Assert . That ( r5_1 , Has . All . With . Property ( "Key" ) . Contains ( 1 ) ) ;
622633
634+ var r6_1 = q5a . ToList ( ) ;
635+ Assert . That ( r6_1 . Count , Is . EqualTo ( 3 ) ) ;
636+ Assert . That ( r6_1 , Has . All . With . Property ( "Key" ) . Contains ( 1 ) ) ;
637+
623638 constKey = 2 ;
624639
625640 var r1_2 = q1 . ToList ( ) ;
@@ -632,7 +647,11 @@ public void GroupByKeyWithConstantFromVariable()
632647
633648 var r3_2 = q3 . ToList ( ) ;
634649 Assert . That ( r3_2 . Count , Is . EqualTo ( 1 ) ) ;
635- Assert . That ( r3_2 , Has . All . With . Property ( "Key" ) . EqualTo ( new object [ ] { constKey } ) ) ;
650+ Assert . That ( r3_2 , Has . All . With . Property ( "Key" ) . EquivalentTo ( new object [ ] { 2 } ) ) ;
651+
652+ var r3a_2 = q3a . ToList ( ) ;
653+ Assert . That ( r3a_2 . Count , Is . EqualTo ( 1 ) ) ;
654+ Assert . That ( r3a_2 , Has . All . With . Property ( "Key" ) . EquivalentTo ( new object [ ] { 2 } ) ) ;
636655
637656 var r4_2 = q4 . ToList ( ) ;
638657 Assert . That ( r4_2 . Count , Is . EqualTo ( 3 ) ) ;
@@ -641,6 +660,10 @@ public void GroupByKeyWithConstantFromVariable()
641660 var r5_2 = q5 . ToList ( ) ;
642661 Assert . That ( r5_2 . Count , Is . EqualTo ( 3 ) ) ;
643662 Assert . That ( r5_2 , Has . All . With . Property ( "Key" ) . Contains ( 2 ) ) ;
663+
664+ var r6_2 = q5 . ToList ( ) ;
665+ Assert . That ( r6_2 . Count , Is . EqualTo ( 3 ) ) ;
666+ Assert . That ( r6_2 , Has . All . With . Property ( "Key" ) . Contains ( 2 ) ) ;
644667 }
645668
646669 [ Test ( Description = "NH-3801" ) ]
0 commit comments