@@ -109,11 +109,18 @@ public virtual Task GroupBy_is_optimized_when_grouping_by_row_and_projecting_col
109
109
[ ConditionalTheory ]
110
110
[ MemberData ( nameof ( IsAsyncData ) ) ]
111
111
public virtual Task Grouping_by_all_columns_doesnt_produce_a_groupby_statement ( bool async )
112
- // GroupBy entityType. Issue #17653.
113
- => AssertTranslationFailed (
114
- ( ) => AssertQuery (
115
- async ,
116
- ss => ss . Set < ArubaOwner > ( ) . GroupBy ( o => o ) . Select ( g => g . Key ) ) ) ;
112
+ => AssertQuery (
113
+ async ,
114
+ ss => ss . Set < ArubaOwner > ( ) . GroupBy ( o => o ) . Select ( g => g . Key ) ,
115
+ elementSorter: e => e. Id ,
116
+ elementAsserter : ( e , a ) =>
117
+ {
118
+ Assert . Equal ( e . Id , a . Id ) ;
119
+ Assert . Equal ( e . Alias , a . Alias ) ;
120
+ Assert . Equal ( e . FirstName, a . FirstName) ;
121
+ Assert . Equal ( e . LastName, a . LastName ) ;
122
+ } ,
123
+ entryCount : 10 ) ;
117
124
118
125
[ ConditionalTheory ]
119
126
[ MemberData ( nameof ( IsAsyncData ) ) ]
@@ -132,111 +139,93 @@ public virtual Task Grouping_by_all_columns_with_aggregate_function_works_1(bool
132
139
[ ConditionalTheory ]
133
140
[ MemberData ( nameof ( IsAsyncData ) ) ]
134
141
public virtual Task Grouping_by_all_columns_with_aggregate_function_works_2 ( bool async )
135
- // GroupBy entityType. Issue #17653.
136
- => AssertTranslationFailed (
137
- ( ) => AssertQueryScalar (
138
- async ,
139
- ss => ss . Set < ArubaOwner > ( ) . GroupBy ( o => o , c => new { c . LastName , c . FirstName } , ( k , g ) => g . Count ( ) ) ) ) ;
142
+ => AssertQueryScalar (
143
+ async ,
144
+ ss => ss . Set < ArubaOwner > ( ) . GroupBy ( o => o , c => new { c . LastName , c . FirstName } , ( k , g ) => g . Count ( ) ) ) ;
140
145
141
146
[ ConditionalTheory ]
142
147
[ MemberData ( nameof ( IsAsyncData ) ) ]
143
148
public virtual Task Grouping_by_all_columns_with_aggregate_function_works_3 ( bool async )
144
- // GroupBy entityType. Issue #17653.
145
- => AssertTranslationFailed (
146
- ( ) => AssertQueryScalar (
147
- async ,
148
- ss => ss . Set < ArubaOwner > ( ) . GroupBy ( o => o , c => c , ( k , g ) => g . Count ( ) ) ) ) ;
149
+ => AssertQueryScalar (
150
+ async ,
151
+ ss => ss . Set < ArubaOwner > ( ) . GroupBy ( o => o , c => c , ( k , g ) => g . Count ( ) ) ) ;
149
152
150
153
[ ConditionalTheory ]
151
154
[ MemberData ( nameof ( IsAsyncData ) ) ]
152
155
public virtual Task Grouping_by_all_columns_with_aggregate_function_works_4 ( bool async )
153
- // GroupBy entityType. Issue #17653.
154
- => AssertTranslationFailed (
155
- ( ) => AssertQuery (
156
- async ,
157
- ss => ss . Set < ArubaOwner > ( ) . GroupBy ( o => o , c => c , ( k , g ) => new { Count = g . Count ( ) } ) ) ) ;
156
+ => AssertQuery (
157
+ async ,
158
+ ss => ss . Set < ArubaOwner > ( ) . GroupBy ( o => o , c => c , ( k , g ) => new { Count = g . Count ( ) } ) ) ;
158
159
159
160
[ ConditionalTheory ]
160
161
[ MemberData ( nameof ( IsAsyncData ) ) ]
161
162
public virtual Task Grouping_by_all_columns_with_aggregate_function_works_5 ( bool async )
162
- // GroupBy entityType. Issue #17653.
163
- => AssertTranslationFailed (
164
- ( ) => AssertQuery (
165
- async ,
166
- ss => ss . Set < ArubaOwner > ( ) . GroupBy ( o => o , c => c , ( k , g ) => new { k . Id , Count = g . Count ( ) } ) ) ) ;
163
+ => AssertQuery (
164
+ async ,
165
+ ss => ss . Set < ArubaOwner > ( ) . GroupBy ( o => o , c => c , ( k , g ) => new { k . Id , Count = g . Count ( ) } ) ) ;
167
166
168
167
[ ConditionalTheory ]
169
168
[ MemberData ( nameof ( IsAsyncData ) ) ]
170
169
public virtual Task Grouping_by_all_columns_with_aggregate_function_works_6 ( bool async )
171
- // GroupBy entityType. Issue #17653.
172
- => AssertTranslationFailed (
173
- ( ) => AssertQuery (
174
- async ,
175
- ss => ss . Set < ArubaOwner > ( ) . GroupBy (
176
- o => o , c => c , ( k , g ) => new
177
- {
178
- k . Id ,
179
- k . Alias ,
180
- Count = g . Count ( )
181
- } ) ) ) ;
170
+ => AssertQuery (
171
+ async ,
172
+ ss => ss . Set < ArubaOwner > ( ) . GroupBy (
173
+ o => o , c => c , ( k , g ) => new
174
+ {
175
+ k . Id ,
176
+ k . Alias ,
177
+ Count = g . Count ( )
178
+ } ) ) ;
182
179
183
180
[ ConditionalTheory ]
184
181
[ MemberData ( nameof ( IsAsyncData ) ) ]
185
182
public virtual Task Grouping_by_all_columns_with_aggregate_function_works_7 ( bool async )
186
- // GroupBy entityType. Issue #17653.
187
- => AssertTranslationFailed (
188
- ( ) => AssertQueryScalar (
189
- async ,
190
- ss => from o in ss . Set < ArubaOwner > ( )
191
- group o by o
192
- into g
193
- select g . Count ( ) ) ) ;
183
+ => AssertQueryScalar (
184
+ async ,
185
+ ss => from o in ss . Set < ArubaOwner > ( )
186
+ group o by o
187
+ into g
188
+ select g . Count ( ) ) ;
194
189
195
190
[ ConditionalTheory ]
196
191
[ MemberData ( nameof ( IsAsyncData ) ) ]
197
192
public virtual Task Grouping_by_all_columns_with_aggregate_function_works_8 ( bool async )
198
- // GroupBy entityType. Issue #17653.
199
- => AssertTranslationFailed (
200
- ( ) => AssertQuery (
201
- async ,
202
- ss => from o in ss . Set < ArubaOwner > ( )
203
- group o by o
204
- into g
205
- select new { g . Key . Id , Count = g . Count ( ) } ) ) ;
193
+ => AssertQuery (
194
+ async ,
195
+ ss => from o in ss . Set < ArubaOwner > ( )
196
+ group o by o
197
+ into g
198
+ select new { g . Key . Id , Count = g . Count ( ) } ) ;
206
199
207
200
[ ConditionalTheory ]
208
201
[ MemberData ( nameof ( IsAsyncData ) ) ]
209
202
public virtual Task Grouping_by_all_columns_with_aggregate_function_works_9 ( bool async )
210
- // GroupBy entityType. Issue #17653.
211
- => AssertTranslationFailed (
212
- ( ) => AssertQuery (
213
- async ,
214
- ss => from o in ss . Set < ArubaOwner > ( )
215
- group o by o
216
- into g
217
- select new
218
- {
219
- g . Key . Id ,
220
- g . Key . Alias ,
221
- Count = g . Count ( )
222
- } ) ) ;
203
+ => AssertQuery (
204
+ async ,
205
+ ss => from o in ss . Set < ArubaOwner > ( )
206
+ group o by o
207
+ into g
208
+ select new
209
+ {
210
+ g . Key . Id ,
211
+ g . Key . Alias ,
212
+ Count = g . Count ( )
213
+ } ) ;
223
214
224
215
[ ConditionalTheory ]
225
216
[ MemberData ( nameof ( IsAsyncData ) ) ]
226
217
public virtual Task Grouping_by_all_columns_with_aggregate_function_works_10 ( bool async )
227
- // GroupBy entityType. Issue #17653.
228
- => AssertTranslationFailed (
229
- ( ) => AssertQuery (
230
- async ,
231
- ss => from o in ss . Set < ArubaOwner > ( )
232
- group o by o
233
- into g
234
- select new
235
- {
236
- g . Key . Id ,
237
- Sum = g . Sum ( x => x . Id ) ,
238
- Count = g . Count ( )
239
- } ) ) ;
218
+ => AssertQuery (
219
+ async ,
220
+ ss => from o in ss . Set < ArubaOwner > ( )
221
+ group o by o
222
+ into g
223
+ select new
224
+ {
225
+ g . Key . Id ,
226
+ Sum = g . Sum ( x => x . Id ) ,
227
+ Count = g . Count ( )
228
+ } ) ;
240
229
241
230
[ ConditionalTheory ]
242
231
[ MemberData ( nameof ( IsAsyncData ) ) ]
@@ -731,7 +720,6 @@ public virtual Task Whats_new_2021_sample_13(bool async)
731
720
[ ConditionalTheory ] // From #12088
732
721
[ MemberData ( nameof ( IsAsyncData ) ) ]
733
722
public virtual Task Whats_new_2021_sample_14 ( bool async )
734
- // GroupBy entityType. Issue #17653.
735
723
=> AssertTranslationFailed (
736
724
( ) => AssertQuery (
737
725
async ,
@@ -742,13 +730,12 @@ public virtual Task Whats_new_2021_sample_14(bool async)
742
730
[ ConditionalTheory ] // From #12088
743
731
[ MemberData ( nameof ( IsAsyncData ) ) ]
744
732
public virtual Task Whats_new_2021_sample_15 ( bool async )
745
- // GroupBy entityType. Issue #17653.
746
- => AssertTranslationFailed (
747
- ( ) => AssertQuery (
748
- async ,
749
- ss => ss . Set < Person > ( )
750
- . GroupBy ( bp => bp . Feet )
751
- . Select ( g => g . OrderByDescending ( bp => bp . Id ) . FirstOrDefault ( ) ) ) ) ;
733
+ => AssertQuery (
734
+ async ,
735
+ ss => ss . Set < Person > ( )
736
+ . GroupBy ( bp => bp . Feet )
737
+ . Select ( g => g . OrderByDescending ( bp => bp . Id ) . FirstOrDefault ( ) ) ,
738
+ entryCount: 12 ) ;
752
739
753
740
[ ConditionalTheory ] // From #12573
754
741
[ MemberData ( nameof ( IsAsyncData ) ) ]
0 commit comments