From 58b46ae614b6d0a2fa169008d2916482c698c49e Mon Sep 17 00:00:00 2001 From: Arthur Vickers Date: Sat, 18 Dec 2021 10:20:20 +0000 Subject: [PATCH] No test left behind: Ef6GroupByTest (#26974) --- .../Query/Ef6GroupByInMemoryTest.cs | 40 -- .../Query/Ef6GroupByTestBase.cs | 366 +++++++------ .../Query/Ef6GroupBySqlServerTest.cs | 490 ++++++++++++++++-- .../Query/Ef6GroupBySqliteTest.cs | 93 ++-- 4 files changed, 712 insertions(+), 277 deletions(-) diff --git a/test/EFCore.InMemory.FunctionalTests/Query/Ef6GroupByInMemoryTest.cs b/test/EFCore.InMemory.FunctionalTests/Query/Ef6GroupByInMemoryTest.cs index ab211ffd985..fa6c6cec4df 100644 --- a/test/EFCore.InMemory.FunctionalTests/Query/Ef6GroupByInMemoryTest.cs +++ b/test/EFCore.InMemory.FunctionalTests/Query/Ef6GroupByInMemoryTest.cs @@ -18,46 +18,6 @@ group p by p.Category into g select new { Category = g.Key, AveragePrice = g.Average(p => p.UnitPrice) }); - [ConditionalTheory(Skip = "Issue #17653")] - public override async Task Grouping_by_all_columns_doesnt_produce_a_groupby_statement(bool async) - => await base.Grouping_by_all_columns_doesnt_produce_a_groupby_statement(async); - - [ConditionalTheory(Skip = "Issue #17653")] - public override async Task Grouping_by_all_columns_with_aggregate_function_works_2(bool async) - => await base.Grouping_by_all_columns_with_aggregate_function_works_2(async); - - [ConditionalTheory(Skip = "Issue #17653")] - public override async Task Grouping_by_all_columns_with_aggregate_function_works_3(bool async) - => await base.Grouping_by_all_columns_with_aggregate_function_works_3(async); - - [ConditionalTheory(Skip = "Issue #17653")] - public override async Task Grouping_by_all_columns_with_aggregate_function_works_4(bool async) - => await base.Grouping_by_all_columns_with_aggregate_function_works_4(async); - - [ConditionalTheory(Skip = "Issue #17653")] - public override async Task Grouping_by_all_columns_with_aggregate_function_works_5(bool async) - => await base.Grouping_by_all_columns_with_aggregate_function_works_5(async); - - [ConditionalTheory(Skip = "Issue #17653")] - public override async Task Grouping_by_all_columns_with_aggregate_function_works_6(bool async) - => await base.Grouping_by_all_columns_with_aggregate_function_works_6(async); - - [ConditionalTheory(Skip = "Issue #17653")] - public override async Task Grouping_by_all_columns_with_aggregate_function_works_7(bool async) - => await base.Grouping_by_all_columns_with_aggregate_function_works_7(async); - - [ConditionalTheory(Skip = "Issue #17653")] - public override async Task Grouping_by_all_columns_with_aggregate_function_works_8(bool async) - => await base.Grouping_by_all_columns_with_aggregate_function_works_8(async); - - [ConditionalTheory(Skip = "Issue #17653")] - public override async Task Grouping_by_all_columns_with_aggregate_function_works_9(bool async) - => await base.Grouping_by_all_columns_with_aggregate_function_works_9(async); - - [ConditionalTheory(Skip = "Issue #17653")] - public override async Task Grouping_by_all_columns_with_aggregate_function_works_10(bool async) - => await base.Grouping_by_all_columns_with_aggregate_function_works_10(async); - public class Ef6GroupByInMemoryFixture : Ef6GroupByFixtureBase { protected override ITestStoreFactory TestStoreFactory diff --git a/test/EFCore.Specification.Tests/Query/Ef6GroupByTestBase.cs b/test/EFCore.Specification.Tests/Query/Ef6GroupByTestBase.cs index 24b9128fc4f..46987ca8e17 100644 --- a/test/EFCore.Specification.Tests/Query/Ef6GroupByTestBase.cs +++ b/test/EFCore.Specification.Tests/Query/Ef6GroupByTestBase.cs @@ -109,9 +109,11 @@ public virtual Task GroupBy_is_optimized_when_grouping_by_row_and_projecting_col [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Grouping_by_all_columns_doesnt_produce_a_groupby_statement(bool async) - => AssertQuery( - async, - ss => ss.Set().GroupBy(o => o).Select(g => g.Key)); + // GroupBy entityType. Issue #17653. + => AssertTranslationFailed( + () => AssertQuery( + async, + ss => ss.Set().GroupBy(o => o).Select(g => g.Key))); [ConditionalTheory] [MemberData(nameof(IsAsyncData))] @@ -130,168 +132,198 @@ public virtual Task Grouping_by_all_columns_with_aggregate_function_works_1(bool [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Grouping_by_all_columns_with_aggregate_function_works_2(bool async) - => AssertQueryScalar( - async, - ss => ss.Set().GroupBy(o => o, c => new { c.LastName, c.FirstName }, (k, g) => g.Count())); + // GroupBy entityType. Issue #17653. + => AssertTranslationFailed( + () => AssertQueryScalar( + async, + ss => ss.Set().GroupBy(o => o, c => new { c.LastName, c.FirstName }, (k, g) => g.Count()))); [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Grouping_by_all_columns_with_aggregate_function_works_3(bool async) - => AssertQueryScalar( - async, - ss => ss.Set().GroupBy(o => o, c => c, (k, g) => g.Count())); + // GroupBy entityType. Issue #17653. + => AssertTranslationFailed( + () => AssertQueryScalar( + async, + ss => ss.Set().GroupBy(o => o, c => c, (k, g) => g.Count()))); [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Grouping_by_all_columns_with_aggregate_function_works_4(bool async) - => AssertQuery( - async, - ss => ss.Set().GroupBy(o => o, c => c, (k, g) => new { Count = g.Count() })); + // GroupBy entityType. Issue #17653. + => AssertTranslationFailed( + () => AssertQuery( + async, + ss => ss.Set().GroupBy(o => o, c => c, (k, g) => new { Count = g.Count() }))); [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Grouping_by_all_columns_with_aggregate_function_works_5(bool async) - => AssertQuery( - async, - ss => ss.Set().GroupBy(o => o, c => c, (k, g) => new { k.Id, Count = g.Count() })); + // GroupBy entityType. Issue #17653. + => AssertTranslationFailed( + () => AssertQuery( + async, + ss => ss.Set().GroupBy(o => o, c => c, (k, g) => new { k.Id, Count = g.Count() }))); [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Grouping_by_all_columns_with_aggregate_function_works_6(bool async) - => AssertQuery( - async, - ss => ss.Set().GroupBy( - o => o, c => c, (k, g) => new - { - k.Id, - k.Alias, - Count = g.Count() - })); + // GroupBy entityType. Issue #17653. + => AssertTranslationFailed( + () => AssertQuery( + async, + ss => ss.Set().GroupBy( + o => o, c => c, (k, g) => new + { + k.Id, + k.Alias, + Count = g.Count() + }))); [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Grouping_by_all_columns_with_aggregate_function_works_7(bool async) - => AssertQueryScalar( - async, - ss => from o in ss.Set() - group o by o - into g - select g.Count()); + // GroupBy entityType. Issue #17653. + => AssertTranslationFailed( + () => AssertQueryScalar( + async, + ss => from o in ss.Set() + group o by o + into g + select g.Count())); [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Grouping_by_all_columns_with_aggregate_function_works_8(bool async) - => AssertQuery( - async, - ss => from o in ss.Set() - group o by o - into g - select new { g.Key.Id, Count = g.Count() }); + // GroupBy entityType. Issue #17653. + => AssertTranslationFailed( + () => AssertQuery( + async, + ss => from o in ss.Set() + group o by o + into g + select new { g.Key.Id, Count = g.Count() })); [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Grouping_by_all_columns_with_aggregate_function_works_9(bool async) - => AssertQuery( - async, - ss => from o in ss.Set() - group o by o - into g - select new - { - g.Key.Id, - g.Key.Alias, - Count = g.Count() - }); + // GroupBy entityType. Issue #17653. + => AssertTranslationFailed( + () => AssertQuery( + async, + ss => from o in ss.Set() + group o by o + into g + select new + { + g.Key.Id, + g.Key.Alias, + Count = g.Count() + })); [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Grouping_by_all_columns_with_aggregate_function_works_10(bool async) - => AssertQuery( - async, - ss => from o in ss.Set() - group o by o - into g - select new - { - g.Key.Id, - Sum = g.Sum(x => x.Id), - Count = g.Count() - }); + // GroupBy entityType. Issue #17653. + => AssertTranslationFailed( + () => AssertQuery( + async, + ss => from o in ss.Set() + group o by o + into g + select new + { + g.Key.Id, + Sum = g.Sum(x => x.Id), + Count = g.Count() + })); - [ConditionalTheory(Skip = "Issue #19929")] + [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task GroupBy_Simple_1_from_LINQ_101(bool async) - => AssertQuery( - async, - ss => from n in ss.Set() - group n by n.Value % 5 - into g - select new { Remainder = g.Key, Numbers = g }); + // GroupBy final operator. Issue #19929. + => AssertTranslationFailed( + () => AssertQuery( + async, + ss => from n in ss.Set() + group n by n.Value % 5 + into g + select new { Remainder = g.Key, Numbers = g })); - [ConditionalTheory(Skip = "Issue #19929")] + [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task GroupBy_Simple_2_from_LINQ_101(bool async) - => AssertQuery( - async, - ss => from w in ss.Set() - group w by w.Name.Length - into g - select new { FirstLetter = g.Key, Words = g }); + // GroupBy final operator. Issue #19929. + => AssertTranslationFailed( + () => AssertQuery( + async, + ss => from w in ss.Set() + group w by w.Name.Length + into g + select new { FirstLetter = g.Key, Words = g })); - [ConditionalTheory(Skip = "Issue #19929")] + [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task GroupBy_Simple_3_from_LINQ_101(bool async) - => AssertQuery( - async, - ss => from p in ss.Set() - group p by p.Category - into g - select new { Category = g.Key, Products = g }); + // GroupBy final operator. Issue #19929. + => AssertTranslationFailed( + () => AssertQuery( + async, + ss => from p in ss.Set() + group p by p.Category + into g + select new { Category = g.Key, Products = g })); - [ConditionalTheory(Skip = "Issue #19929")] + [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task GroupBy_Nested_from_LINQ_101(bool async) - => AssertQuery( - async, - ss => from c in ss.Set() - select new - { - c.CompanyName, - YearGroups = from o in c.Orders - group o by o.OrderDate.Year - into yg - select new - { - Year = yg.Key, - MonthGroups = from o in yg - group o by o.OrderDate.Month - into mg - select - new { Month = mg.Key, Orders = mg } - } - }); + // GroupBy final operator. Issue #19929. + => AssertTranslationFailed( + () => AssertQuery( + async, + ss => from c in ss.Set() + select new + { + c.CompanyName, + YearGroups = from o in c.Orders + group o by o.OrderDate.Year + into yg + select new + { + Year = yg.Key, + MonthGroups = from o in yg + group o by o.OrderDate.Month + into mg + select + new { Month = mg.Key, Orders = mg } + } + })); - [ConditionalTheory(Skip = "Issue #19929")] + [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Any_Grouped_from_LINQ_101(bool async) - => AssertQuery( - async, - ss => from p in ss.Set() - group p by p.Category - into g - where g.Any(p => p.UnitsInStock == 0) - select new { Category = g.Key, Products = g }); + // GroupBy final operator. Issue #19929. + => AssertTranslationFailed( + () => AssertQuery( + async, + ss => from p in ss.Set() + group p by p.Category + into g + where g.Any(p => p.UnitsInStock == 0) + select new { Category = g.Key, Products = g })); - [ConditionalTheory(Skip = "Issue #19929")] + [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task All_Grouped_from_LINQ_101(bool async) - => AssertQuery( - async, - ss => from p in ss.Set() - group p by p.Category - into g - where g.All(p => p.UnitsInStock > 0) - select new { Category = g.Key, Products = g }); + // GroupBy final operator. Issue #19929. + => AssertTranslationFailed( + () => AssertQuery( + async, + ss => from p in ss.Set() + group p by p.Category + into g + where g.All(p => p.UnitsInStock > 0) + select new { Category = g.Key, Products = g })); [ConditionalTheory] [MemberData(nameof(IsAsyncData))] @@ -333,16 +365,18 @@ group p by p.Category into g select new { Category = g.Key, CheapestPrice = g.Min(p => p.UnitPrice) }); - [ConditionalTheory(Skip = "Issue #23206")] + [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Min_Elements_from_LINQ_101(bool async) - => AssertQuery( - async, - ss => from p in ss.Set() - group p by p.Category - into g - let minPrice = g.Min(p => p.UnitPrice) - select new { Category = g.Key, CheapestProducts = g.Where(p => p.UnitPrice == minPrice) }); + // Navigation expansion phase 2. Issue #23206. + => AssertTranslationFailed( + () => AssertQuery( + async, + ss => from p in ss.Set() + group p by p.Category + into g + let minPrice = g.Min(p => p.UnitPrice) + select new { Category = g.Key, CheapestProducts = g.Where(p => p.UnitPrice == minPrice) })); [ConditionalTheory] [MemberData(nameof(IsAsyncData))] @@ -354,16 +388,18 @@ group p by p.Category into g select new { Category = g.Key, MostExpensivePrice = g.Max(p => p.UnitPrice) }); - [ConditionalTheory(Skip = "Issue #23206")] + [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Max_Elements_from_LINQ_101(bool async) - => AssertQuery( - async, - ss => from p in ss.Set() - group p by p.Category - into g - let minPrice = g.Max(p => p.UnitPrice) - select new { Category = g.Key, MostExpensiveProducts = g.Where(p => p.UnitPrice == minPrice) }); + // Navigation expansion phase 2. Issue #23206. + => AssertTranslationFailed( + () => AssertQuery( + async, + ss => from p in ss.Set() + group p by p.Category + into g + let minPrice = g.Max(p => p.UnitPrice) + select new { Category = g.Key, MostExpensiveProducts = g.Where(p => p.UnitPrice == minPrice) })); [ConditionalTheory] [MemberData(nameof(IsAsyncData))] @@ -379,14 +415,16 @@ group p by p.Category into g select new { Category = g.Key, AveragePrice = Math.Round(g.Average(p => p.UnitPrice) - 0.0000005m, 6) }); - [ConditionalTheory(Skip = "Issue #19930")] + [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Group_Join_from_LINQ_101(bool async) - => AssertQuery( - async, - ss => from c in ss.Set() - join o in ss.Set() on c equals o.Customer into ps - select new { Customer = c, Products = ps }); + // GroupJoin final operator. Issue #19930. + => AssertTranslationFailed( + () => AssertQuery( + async, + ss => from c in ss.Set() + join o in ss.Set() on c equals o.Customer into ps + select new { Customer = c, Products = ps })); [ConditionalTheory] [MemberData(nameof(IsAsyncData))] @@ -458,7 +496,7 @@ public virtual Task Whats_new_2021_sample_2(bool async) .OrderBy(e => e.Key) .Select(g => g.First())); - [ConditionalTheory(Skip = "Issue #26104")] // From #12640 + [ConditionalTheory] // From #12640 [MemberData(nameof(IsAsyncData))] public virtual Task Whats_new_2021_sample_3(bool async) => AssertQuery( @@ -486,7 +524,7 @@ into people Count = people.Count() }); - [ConditionalTheory(Skip = "Issue #26104")] // From #12601 + [ConditionalTheory] // From #12601 [MemberData(nameof(IsAsyncData))] public virtual Task Whats_new_2021_sample_5(bool async) => AssertQuery( @@ -497,7 +535,7 @@ public virtual Task Whats_new_2021_sample_5(bool async) .OrderBy(e => e), assertOrder: true); - [ConditionalTheory(Skip = "Issue #26104")] // From #12600 + [ConditionalTheory] // From #12600 [MemberData(nameof(IsAsyncData))] public virtual Task Whats_new_2021_sample_6(bool async) => AssertQuery( @@ -688,34 +726,40 @@ public virtual Task Whats_new_2021_sample_13(bool async) }, entryCount: 12); - [ConditionalTheory(Skip = "Issue #17653")] // From #12088 + [ConditionalTheory] // From #12088 [MemberData(nameof(IsAsyncData))] public virtual Task Whats_new_2021_sample_14(bool async) - => AssertQuery( - async, - ss => ss.Set() - .GroupBy(bp => bp.Feet) - .SelectMany(g => g.OrderByDescending(bp => bp.Id).Take(1).DefaultIfEmpty())); + // GroupBy entityType. Issue #17653. + => AssertTranslationFailed( + () => AssertQuery( + async, + ss => ss.Set() + .GroupBy(bp => bp.Feet) + .SelectMany(g => g.OrderByDescending(bp => bp.Id).Take(1).DefaultIfEmpty()))); - [ConditionalTheory(Skip = "Issue #17653")] // From #12088 + [ConditionalTheory] // From #12088 [MemberData(nameof(IsAsyncData))] public virtual Task Whats_new_2021_sample_15(bool async) - => AssertQuery( - async, - ss => ss.Set() - .GroupBy(bp => bp.Feet) - .Select(g => g.OrderByDescending(bp => bp.Id).FirstOrDefault())); - - [ConditionalTheory(Skip = "Issues #19929")] // From #12573 + // GroupBy entityType. Issue #17653. + => AssertTranslationFailed( + () => AssertQuery( + async, + ss => ss.Set() + .GroupBy(bp => bp.Feet) + .Select(g => g.OrderByDescending(bp => bp.Id).FirstOrDefault()))); + + [ConditionalTheory] // From #12573 [MemberData(nameof(IsAsyncData))] public virtual Task Whats_new_2021_sample_16(bool async) - => AssertQuery( - async, - ss => ss.Set() - .GroupBy(c => c.LastName) - .Select(g => g.OrderBy(c => c.FirstName).First()) - .GroupBy(c => c.MiddleInitial) - .Select(g => g)); + // GroupBy final operator. Issue #19929. + => AssertTranslationFailed( + () => AssertQuery( + async, + ss => ss.Set() + .GroupBy(c => c.LastName) + .Select(g => g.OrderBy(c => c.FirstName).First()) + .GroupBy(c => c.MiddleInitial) + .Select(g => g))); protected ArubaContext CreateContext() => Fixture.CreateContext(); diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/Ef6GroupBySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/Ef6GroupBySqlServerTest.cs index 14cb68b7faf..1cd5c731557 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/Ef6GroupBySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/Ef6GroupBySqlServerTest.cs @@ -12,6 +12,10 @@ public Ef6GroupBySqlServerTest(Ef6GroupBySqlServerFixture fixture, ITestOutputHe //Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper); } + [ConditionalFact] + public virtual void Check_all_tests_overridden() + => TestHelpers.AssertAllMethodsOverridden(GetType()); + public override async Task GroupBy_is_optimized_when_projecting_group_key(bool async) { await base.GroupBy_is_optimized_when_projecting_group_key(async); @@ -253,13 +257,11 @@ WHERE [a].[Id] < 4 // ) AS [Distinct1]"; } - [ConditionalTheory(Skip = "Issue #17653")] public override async Task Grouping_by_all_columns_doesnt_produce_a_groupby_statement(bool async) { await base.Grouping_by_all_columns_doesnt_produce_a_groupby_statement(async); - AssertSql( - @""); + AssertSql(); // EF6 SQL: // @"SELECT @@ -288,13 +290,11 @@ FROM [ArubaOwner] AS [a] // FROM [dbo].[ArubaOwners] AS [Extent1]"; } - [ConditionalTheory(Skip = "Issue #17653")] public override async Task Grouping_by_all_columns_with_aggregate_function_works_2(bool async) { await base.Grouping_by_all_columns_with_aggregate_function_works_2(async); - AssertSql( - @""); + AssertSql(); // EF6 SQL: // @"SELECT @@ -305,13 +305,11 @@ public override async Task Grouping_by_all_columns_with_aggregate_function_works // FROM [dbo].[ArubaOwners] AS [Extent1]"; } - [ConditionalTheory(Skip = "Issue #17653")] public override async Task Grouping_by_all_columns_with_aggregate_function_works_3(bool async) { await base.Grouping_by_all_columns_with_aggregate_function_works_3(async); - AssertSql( - @""); + AssertSql(); // EF6 SQL: // @"SELECT @@ -322,13 +320,11 @@ public override async Task Grouping_by_all_columns_with_aggregate_function_works // FROM [dbo].[ArubaOwners] AS [Extent1]"; } - [ConditionalTheory(Skip = "Issue #17653")] public override async Task Grouping_by_all_columns_with_aggregate_function_works_4(bool async) { await base.Grouping_by_all_columns_with_aggregate_function_works_4(async); - AssertSql( - @""); + AssertSql(); // EF6 SQL: // @"SELECT @@ -345,13 +341,11 @@ public override async Task Grouping_by_all_columns_with_aggregate_function_works // ) AS [GroupBy1]"; } - [ConditionalTheory(Skip = "Issue #17653")] public override async Task Grouping_by_all_columns_with_aggregate_function_works_5(bool async) { await base.Grouping_by_all_columns_with_aggregate_function_works_5(async); - AssertSql( - @""); + AssertSql(); // EF6 SQL: // @"SELECT @@ -368,13 +362,11 @@ public override async Task Grouping_by_all_columns_with_aggregate_function_works // ) AS [GroupBy1]"; } - [ConditionalTheory(Skip = "Issue #17653")] public override async Task Grouping_by_all_columns_with_aggregate_function_works_6(bool async) { await base.Grouping_by_all_columns_with_aggregate_function_works_6(async); - AssertSql( - @""); + AssertSql(); // EF6 SQL: // @"SELECT @@ -392,13 +384,11 @@ public override async Task Grouping_by_all_columns_with_aggregate_function_works // ) AS [GroupBy1]"; } - [ConditionalTheory(Skip = "Issue #17653")] public override async Task Grouping_by_all_columns_with_aggregate_function_works_7(bool async) { await base.Grouping_by_all_columns_with_aggregate_function_works_7(async); - AssertSql( - @""); + AssertSql(); // EF6 SQL: // @"SELECT @@ -409,13 +399,11 @@ public override async Task Grouping_by_all_columns_with_aggregate_function_works // FROM [dbo].[ArubaOwners] AS [Extent1]"; } - [ConditionalTheory(Skip = "Issue #17653")] public override async Task Grouping_by_all_columns_with_aggregate_function_works_8(bool async) { await base.Grouping_by_all_columns_with_aggregate_function_works_8(async); - AssertSql( - @""); + AssertSql(); // EF6 SQL: // @"SELECT @@ -432,13 +420,11 @@ public override async Task Grouping_by_all_columns_with_aggregate_function_works // ) AS [GroupBy1]"; } - [ConditionalTheory(Skip = "Issue #17653")] public override async Task Grouping_by_all_columns_with_aggregate_function_works_9(bool async) { await base.Grouping_by_all_columns_with_aggregate_function_works_9(async); - AssertSql( - @""); + AssertSql(); // EF6 SQL: // @"SELECT @@ -456,13 +442,11 @@ public override async Task Grouping_by_all_columns_with_aggregate_function_works // ) AS [GroupBy1]"; } - [ConditionalTheory(Skip = "Issue #17653")] public override async Task Grouping_by_all_columns_with_aggregate_function_works_10(bool async) { await base.Grouping_by_all_columns_with_aggregate_function_works_10(async); - AssertSql( - @""); + AssertSql(); // EF6 SQL: // @"SELECT @@ -481,6 +465,452 @@ public override async Task Grouping_by_all_columns_with_aggregate_function_works // ) AS [GroupBy1]"; } + public override async Task GroupBy_Simple_1_from_LINQ_101(bool async) + { + await base.GroupBy_Simple_1_from_LINQ_101(async); + + AssertSql(); + } + + public override async Task GroupBy_Simple_2_from_LINQ_101(bool async) + { + await base.GroupBy_Simple_2_from_LINQ_101(async); + + AssertSql(); + } + + public override async Task GroupBy_Simple_3_from_LINQ_101(bool async) + { + await base.GroupBy_Simple_3_from_LINQ_101(async); + + AssertSql(); + } + + public override async Task GroupBy_Nested_from_LINQ_101(bool async) + { + await base.GroupBy_Nested_from_LINQ_101(async); + + AssertSql(); + } + + public override async Task Any_Grouped_from_LINQ_101(bool async) + { + await base.Any_Grouped_from_LINQ_101(async); + + AssertSql(); + } + + public override async Task All_Grouped_from_LINQ_101(bool async) + { + await base.All_Grouped_from_LINQ_101(async); + + AssertSql(); + } + + public override async Task Min_Elements_from_LINQ_101(bool async) + { + await base.Min_Elements_from_LINQ_101(async); + + AssertSql(); + } + + public override async Task Max_Elements_from_LINQ_101(bool async) + { + await base.Max_Elements_from_LINQ_101(async); + + AssertSql(); + } + + public override async Task Group_Join_from_LINQ_101(bool async) + { + await base.Group_Join_from_LINQ_101(async); + + AssertSql(); + } + + public override async Task Whats_new_2021_sample_3(bool async) + { +#if DEBUG + // GroupBy debug assert. Issue #26104. + Assert.StartsWith( + "Missing alias in the list", + (await Assert.ThrowsAsync( + () => base.Whats_new_2021_sample_3(async))).Message); + + AssertSql(); +#else + await base.Whats_new_2021_sample_3(async); + + AssertSql( + @"SELECT ( + SELECT TOP(1) [p1].[LastName] + FROM [Person] AS [p1] + WHERE [p1].[MiddleInitial] = N'Q' AND [p1].[Age] = 20 AND ([p].[LastName] = [p1].[LastName] OR ([p].[LastName] IS NULL AND [p1].[LastName] IS NULL))) +FROM [Person] AS [p] +WHERE [p].[MiddleInitial] = N'Q' AND [p].[Age] = 20 +GROUP BY [p].[LastName] +ORDER BY CAST(LEN(( + SELECT TOP(1) [p1].[LastName] + FROM [Person] AS [p1] + WHERE [p1].[MiddleInitial] = N'Q' AND [p1].[Age] = 20 AND ([p].[LastName] = [p1].[LastName] OR ([p].[LastName] IS NULL AND [p1].[LastName] IS NULL)))) AS int)"); +#endif + } + + public override async Task Whats_new_2021_sample_5(bool async) + { +#if DEBUG + // GroupBy debug assert. Issue #26104. + Assert.StartsWith( + "Missing alias in the list", + (await Assert.ThrowsAsync( + () => base.Whats_new_2021_sample_5(async))).Message); + + AssertSql(); +#else + await base.Whats_new_2021_sample_5(async); + + AssertSql( + @"SELECT ( + SELECT TOP(1) [p1].[LastName] + FROM [Person] AS [p1] + WHERE [p].[FirstName] = [p1].[FirstName] OR ([p].[FirstName] IS NULL AND [p1].[FirstName] IS NULL)) +FROM [Person] AS [p] +GROUP BY [p].[FirstName] +ORDER BY ( + SELECT TOP(1) [p1].[LastName] + FROM [Person] AS [p1] + WHERE [p].[FirstName] = [p1].[FirstName] OR ([p].[FirstName] IS NULL AND [p1].[FirstName] IS NULL))"); +#endif + } + + public override async Task Whats_new_2021_sample_6(bool async) + { +#if DEBUG + // GroupBy debug assert. Issue #26104. + Assert.StartsWith( + "Missing alias in the list", + (await Assert.ThrowsAsync( + () => base.Whats_new_2021_sample_6(async))).Message); + + AssertSql(); +#else + await base.Whats_new_2021_sample_6(async); + + AssertSql( + @"SELECT ( + SELECT TOP(1) [p1].[MiddleInitial] + FROM [Person] AS [p1] + WHERE [p1].[Age] = 20 AND [p].[Id] = [p1].[Id]) +FROM [Person] AS [p] +WHERE [p].[Age] = 20 +GROUP BY [p].[Id] +ORDER BY ( + SELECT TOP(1) [p1].[MiddleInitial] + FROM [Person] AS [p1] + WHERE [p1].[Age] = 20 AND [p].[Id] = [p1].[Id])"); +#endif + } + + public override async Task Whats_new_2021_sample_14(bool async) + { + await base.Whats_new_2021_sample_14(async); + + AssertSql(); + } + + public override async Task Whats_new_2021_sample_15(bool async) + { + await base.Whats_new_2021_sample_15(async); + + AssertSql(); + } + + public override async Task Whats_new_2021_sample_16(bool async) + { + await base.Whats_new_2021_sample_16(async); + + AssertSql(); + } + + public override async Task Min_Grouped_from_LINQ_101(bool async) + { + await base.Min_Grouped_from_LINQ_101(async); + + AssertSql( + @"SELECT [p].[Category], MIN([p].[UnitPrice]) AS [CheapestPrice] +FROM [ProductForLinq] AS [p] +GROUP BY [p].[Category]"); + } + + public override async Task Average_Grouped_from_LINQ_101(bool async) + { + await base.Average_Grouped_from_LINQ_101(async); + + AssertSql( + @"SELECT [p].[Category], AVG([p].[UnitPrice]) AS [AveragePrice] +FROM [ProductForLinq] AS [p] +GROUP BY [p].[Category]"); + } + + public override async Task Whats_new_2021_sample_8(bool async) + { + await base.Whats_new_2021_sample_8(async); + + AssertSql( + @"SELECT COUNT(*) +FROM ( + SELECT [f].[Id], [f].[Size] + FROM [Person] AS [p] + LEFT JOIN [Feet] AS [f] ON [p].[Id] = [f].[Id] + GROUP BY [f].[Id], [f].[Size] +) AS [t]"); + } + + public override async Task Whats_new_2021_sample_12(bool async) + { + await base.Whats_new_2021_sample_12(async); + + AssertSql( + @"SELECT [t].[FirstName], [t0].[Id], [t0].[Age], [t0].[FirstName], [t0].[LastName], [t0].[MiddleInitial], [t0].[Id0], [t0].[Age0], [t0].[PersonId], [t0].[Style] +FROM ( + SELECT [p].[FirstName] + FROM [Person] AS [p] + GROUP BY [p].[FirstName] +) AS [t] +LEFT JOIN ( + SELECT [p0].[Id], [p0].[Age], [p0].[FirstName], [p0].[LastName], [p0].[MiddleInitial], [s].[Id] AS [Id0], [s].[Age] AS [Age0], [s].[PersonId], [s].[Style] + FROM [Person] AS [p0] + LEFT JOIN [Shoes] AS [s] ON [p0].[Id] = [s].[PersonId] +) AS [t0] ON [t].[FirstName] = [t0].[FirstName] +ORDER BY [t].[FirstName], [t0].[Id]"); + } + + public override async Task Whats_new_2021_sample_10(bool async) + { + await base.Whats_new_2021_sample_10(async); + + AssertSql( + @"SELECT [t].[Id], [t].[Age], [t].[Style], [t0].[Id], [t0].[Style], [t0].[Age], [t0].[Id0] +FROM ( + SELECT [p].[Id], [s].[Age], [s].[Style] + FROM [Person] AS [p] + INNER JOIN [Shoes] AS [s] ON [p].[Age] = [s].[Age] + GROUP BY [p].[Id], [s].[Style], [s].[Age] +) AS [t] +LEFT JOIN ( + SELECT [s0].[Id], [s0].[Style], [s0].[Age], [p0].[Id] AS [Id0] + FROM [Person] AS [p0] + INNER JOIN [Shoes] AS [s0] ON [p0].[Age] = [s0].[Age] +) AS [t0] ON [t].[Id] = [t0].[Id0] AND ([t].[Style] = [t0].[Style] OR ([t].[Style] IS NULL AND [t0].[Style] IS NULL)) AND [t].[Age] = [t0].[Age] +ORDER BY [t].[Id], [t].[Style], [t].[Age], [t0].[Id0]"); + } + + public override async Task Whats_new_2021_sample_13(bool async) + { + await base.Whats_new_2021_sample_13(async); + + AssertSql( + @"SELECT [t].[FirstName], [t].[MiddleInitial], [p0].[Id], [p0].[Age], [p0].[FirstName], [p0].[LastName], [p0].[MiddleInitial] +FROM ( + SELECT [p].[FirstName], [p].[MiddleInitial] + FROM [Person] AS [p] + GROUP BY [p].[FirstName], [p].[MiddleInitial] +) AS [t] +LEFT JOIN [Person] AS [p0] ON ([t].[FirstName] = [p0].[FirstName] OR ([t].[FirstName] IS NULL AND [p0].[FirstName] IS NULL)) AND ([t].[MiddleInitial] = [p0].[MiddleInitial] OR ([t].[MiddleInitial] IS NULL AND [p0].[MiddleInitial] IS NULL)) +ORDER BY [t].[FirstName], [t].[MiddleInitial], [p0].[Id]"); + } + + public override async Task Cross_Join_with_Group_Join_from_LINQ_101(bool async) + { + await base.Cross_Join_with_Group_Join_from_LINQ_101(async); + + AssertSql( + @"SELECT [c].[Id], [c].[CompanyName], [c].[Region], [t].[Id] +FROM [CustomerForLinq] AS [c] +INNER JOIN ( + SELECT [o].[Id], [c0].[Id] AS [Id0] + FROM [OrderForLinq] AS [o] + LEFT JOIN [CustomerForLinq] AS [c0] ON [o].[CustomerId] = [c0].[Id] +) AS [t] ON [c].[Id] = [t].[Id0]"); + } + + public override async Task Whats_new_2021_sample_2(bool async) + { + await base.Whats_new_2021_sample_2(async); + + AssertSql( + @"SELECT [t0].[FirstName], [t0].[FullName], [t0].[c] +FROM ( + SELECT TOP(1) [p].[FirstName] + FROM [Person] AS [p] + GROUP BY [p].[FirstName] + ORDER BY [p].[FirstName] +) AS [t] +LEFT JOIN ( + SELECT [t1].[FirstName], [t1].[FullName], [t1].[c] + FROM ( + SELECT [p0].[FirstName], (((COALESCE([p0].[FirstName], N'') + N' ') + COALESCE([p0].[MiddleInitial], N'')) + N' ') + COALESCE([p0].[LastName], N'') AS [FullName], 1 AS [c], ROW_NUMBER() OVER(PARTITION BY [p0].[FirstName] ORDER BY [p0].[Id]) AS [row] + FROM [Person] AS [p0] + ) AS [t1] + WHERE [t1].[row] <= 1 +) AS [t0] ON [t].[FirstName] = [t0].[FirstName] +ORDER BY [t].[FirstName]"); + } + + public override async Task Whats_new_2021_sample_1(bool async) + { + await base.Whats_new_2021_sample_1(async); + + AssertSql( + @"SELECT [t0].[Id], [t0].[Age], [t0].[FirstName], [t0].[LastName], [t0].[MiddleInitial], [t].[FirstName], [s].[Id], [s].[Age], [s].[PersonId], [s].[Style] +FROM ( + SELECT [p].[FirstName] + FROM [Person] AS [p] + GROUP BY [p].[FirstName] +) AS [t] +LEFT JOIN ( + SELECT [t1].[Id], [t1].[Age], [t1].[FirstName], [t1].[LastName], [t1].[MiddleInitial] + FROM ( + SELECT [p0].[Id], [p0].[Age], [p0].[FirstName], [p0].[LastName], [p0].[MiddleInitial], ROW_NUMBER() OVER(PARTITION BY [p0].[FirstName] ORDER BY [p0].[FirstName], [p0].[LastName]) AS [row] + FROM [Person] AS [p0] + ) AS [t1] + WHERE [t1].[row] <= 1 +) AS [t0] ON [t].[FirstName] = [t0].[FirstName] +LEFT JOIN [Shoes] AS [s] ON [t0].[Id] = [s].[PersonId] +ORDER BY [t].[FirstName], [t0].[Id]"); + } + + public override async Task Whats_new_2021_sample_7(bool async) + { + await base.Whats_new_2021_sample_7(async); + + AssertSql( + @"@__size_0='11' + +SELECT [p0].[LastName], [f].[Size], MIN([f0].[Size]) AS [Min] +FROM [Person] AS [p] +LEFT JOIN [Feet] AS [f] ON [p].[Id] = [f].[Id] +LEFT JOIN [Person] AS [p0] ON [f].[Id] = [p0].[Id] +LEFT JOIN [Feet] AS [f0] ON [p].[Id] = [f0].[Id] +WHERE [f].[Size] = @__size_0 AND [p].[MiddleInitial] IS NOT NULL AND ([f].[Id] <> 1 OR [f].[Id] IS NULL) +GROUP BY [f].[Size], [p0].[LastName]"); + } + + public override async Task Sum_Grouped_from_LINQ_101(bool async) + { + await base.Sum_Grouped_from_LINQ_101(async); + + AssertSql( + @"SELECT [p].[Category], COALESCE(SUM([p].[UnitsInStock]), 0) AS [TotalUnitsInStock] +FROM [ProductForLinq] AS [p] +GROUP BY [p].[Category]"); + } + + public override async Task Count_Grouped_from_LINQ_101(bool async) + { + await base.Count_Grouped_from_LINQ_101(async); + + AssertSql( + @"SELECT [p].[Category], COUNT(*) AS [ProductCount] +FROM [ProductForLinq] AS [p] +GROUP BY [p].[Category]"); + } + + public override async Task Whats_new_2021_sample_9(bool async) + { + await base.Whats_new_2021_sample_9(async); + + AssertSql( + @"SELECT [p].[FirstName] AS [Feet], COALESCE(SUM([f].[Size]), 0) AS [Total] +FROM [Person] AS [p] +LEFT JOIN [Feet] AS [f] ON [p].[Id] = [f].[Id] +GROUP BY [p].[FirstName]"); + } + + public override async Task LongCount_Grouped_from_LINQ_101(bool async) + { + await base.LongCount_Grouped_from_LINQ_101(async); + + AssertSql( + @"SELECT [p].[Category], COUNT_BIG(*) AS [ProductLongCount] +FROM [ProductForLinq] AS [p] +GROUP BY [p].[Category]"); + } + + public override async Task Whats_new_2021_sample_4(bool async) + { + await base.Whats_new_2021_sample_4(async); + + AssertSql( + @"SELECT [s].[Style] AS [Key], ( + SELECT TOP(1) [s0].[Style] + FROM [Person] AS [p0] + INNER JOIN [Shoes] AS [s0] ON [p0].[Age] = [s0].[Age] + WHERE [s].[Style] = [s0].[Style] OR ([s].[Style] IS NULL AND [s0].[Style] IS NULL)) AS [Style], COUNT(*) AS [Count] +FROM [Person] AS [p] +INNER JOIN [Shoes] AS [s] ON [p].[Age] = [s].[Age] +GROUP BY [s].[Style]"); + } + + public override async Task Left_Outer_Join_with_Group_Join_from_LINQ_101(bool async) + { + await base.Left_Outer_Join_with_Group_Join_from_LINQ_101(async); + + AssertSql( + @"SELECT [c].[Id], [c].[CompanyName], [c].[Region], [t].[Id], [t].[Id0], [o0].[Id], [o0].[CustomerId], [o0].[OrderDate], [o0].[Total], CASE + WHEN [t].[Id] IS NULL THEN -1 + ELSE [t].[Id] +END +FROM [CustomerForLinq] AS [c] +LEFT JOIN ( + SELECT [o].[Id], [c0].[Id] AS [Id0] + FROM [OrderForLinq] AS [o] + LEFT JOIN [CustomerForLinq] AS [c0] ON [o].[CustomerId] = [c0].[Id] +) AS [t] ON [c].[Id] = [t].[Id0] +LEFT JOIN [OrderForLinq] AS [o0] ON [c].[Id] = [o0].[CustomerId] +ORDER BY [c].[Id], [t].[Id], [t].[Id0]"); + } + + public override async Task Max_Grouped_from_LINQ_101(bool async) + { + await base.Max_Grouped_from_LINQ_101(async); + + AssertSql( + @"SELECT [p].[Category], MAX([p].[UnitPrice]) AS [MostExpensivePrice] +FROM [ProductForLinq] AS [p] +GROUP BY [p].[Category]"); + } + + public override async Task Whats_new_2021_sample_11(bool async) + { + await base.Whats_new_2021_sample_11(async); + + AssertSql( + @"SELECT [t].[LastName], [t].[c], [t0].[Id], [t2].[Id], [t2].[Age], [t2].[FirstName], [t2].[LastName], [t2].[MiddleInitial], [t0].[Age], [t0].[FirstName], [t0].[LastName], [t0].[MiddleInitial] +FROM ( + SELECT [p].[LastName], COUNT(*) AS [c] + FROM [Person] AS [p] + GROUP BY [p].[LastName] +) AS [t] +LEFT JOIN ( + SELECT [t1].[Id], [t1].[Age], [t1].[FirstName], [t1].[LastName], [t1].[MiddleInitial] + FROM ( + SELECT [p0].[Id], [p0].[Age], [p0].[FirstName], [p0].[LastName], [p0].[MiddleInitial], ROW_NUMBER() OVER(PARTITION BY [p0].[LastName] ORDER BY [p0].[Id]) AS [row] + FROM [Person] AS [p0] + ) AS [t1] + WHERE [t1].[row] <= 1 +) AS [t0] ON [t].[LastName] = [t0].[LastName] +LEFT JOIN ( + SELECT [t3].[Id], [t3].[Age], [t3].[FirstName], [t3].[LastName], [t3].[MiddleInitial] + FROM ( + SELECT [p1].[Id], [p1].[Age], [p1].[FirstName], [p1].[LastName], [p1].[MiddleInitial], ROW_NUMBER() OVER(PARTITION BY [p1].[LastName] ORDER BY [p1].[Id]) AS [row] + FROM [Person] AS [p1] + ) AS [t3] + WHERE [t3].[row] <= 2 +) AS [t2] ON [t].[LastName] = [t2].[LastName] +ORDER BY [t].[LastName] DESC, [t0].[Id], [t2].[LastName], [t2].[Id]"); + } + private void AssertSql(params string[] expected) => Fixture.TestSqlLoggerFactory.AssertBaseline(expected); diff --git a/test/EFCore.Sqlite.FunctionalTests/Query/Ef6GroupBySqliteTest.cs b/test/EFCore.Sqlite.FunctionalTests/Query/Ef6GroupBySqliteTest.cs index 2dc12b64281..5c475a2bcd6 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Query/Ef6GroupBySqliteTest.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Query/Ef6GroupBySqliteTest.cs @@ -1,6 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using Microsoft.EntityFrameworkCore.Sqlite.Internal; + namespace Microsoft.EntityFrameworkCore.Query; public class Ef6GroupBySqliteTest : Ef6GroupByTestBase @@ -12,57 +14,56 @@ public Ef6GroupBySqliteTest(Ef6GroupBySqliteFixture fixture, ITestOutputHelper t //Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper); } - [ConditionalTheory(Skip = "Issue #19635")] public override async Task Average_Grouped_from_LINQ_101(bool async) - => await base.Average_Grouped_from_LINQ_101(async); + => Assert.Equal( + SqliteStrings.AggregateOperationNotSupported("Average", "decimal"), + (await Assert.ThrowsAsync( + () => base.Average_Grouped_from_LINQ_101(async))).Message); - [ConditionalTheory(Skip = "Issue #19635")] public override async Task Max_Grouped_from_LINQ_101(bool async) - => await base.Max_Grouped_from_LINQ_101(async); + => Assert.Equal( + SqliteStrings.AggregateOperationNotSupported("Max", "decimal"), + (await Assert.ThrowsAsync( + () => base.Max_Grouped_from_LINQ_101(async))).Message); - [ConditionalTheory(Skip = "Issue #19635")] public override async Task Min_Grouped_from_LINQ_101(bool async) - => await base.Min_Grouped_from_LINQ_101(async); - - [ConditionalTheory(Skip = "Issue #17653")] - public override async Task Grouping_by_all_columns_doesnt_produce_a_groupby_statement(bool async) - => await base.Grouping_by_all_columns_doesnt_produce_a_groupby_statement(async); - - [ConditionalTheory(Skip = "Issue #17653")] - public override async Task Grouping_by_all_columns_with_aggregate_function_works_2(bool async) - => await base.Grouping_by_all_columns_with_aggregate_function_works_2(async); - - [ConditionalTheory(Skip = "Issue #17653")] - public override async Task Grouping_by_all_columns_with_aggregate_function_works_3(bool async) - => await base.Grouping_by_all_columns_with_aggregate_function_works_3(async); - - [ConditionalTheory(Skip = "Issue #17653")] - public override async Task Grouping_by_all_columns_with_aggregate_function_works_4(bool async) - => await base.Grouping_by_all_columns_with_aggregate_function_works_4(async); - - [ConditionalTheory(Skip = "Issue #17653")] - public override async Task Grouping_by_all_columns_with_aggregate_function_works_5(bool async) - => await base.Grouping_by_all_columns_with_aggregate_function_works_5(async); - - [ConditionalTheory(Skip = "Issue #17653")] - public override async Task Grouping_by_all_columns_with_aggregate_function_works_6(bool async) - => await base.Grouping_by_all_columns_with_aggregate_function_works_6(async); - - [ConditionalTheory(Skip = "Issue #17653")] - public override async Task Grouping_by_all_columns_with_aggregate_function_works_7(bool async) - => await base.Grouping_by_all_columns_with_aggregate_function_works_7(async); - - [ConditionalTheory(Skip = "Issue #17653")] - public override async Task Grouping_by_all_columns_with_aggregate_function_works_8(bool async) - => await base.Grouping_by_all_columns_with_aggregate_function_works_8(async); - - [ConditionalTheory(Skip = "Issue #17653")] - public override async Task Grouping_by_all_columns_with_aggregate_function_works_9(bool async) - => await base.Grouping_by_all_columns_with_aggregate_function_works_9(async); - - [ConditionalTheory(Skip = "Issue #17653")] - public override async Task Grouping_by_all_columns_with_aggregate_function_works_10(bool async) - => await base.Grouping_by_all_columns_with_aggregate_function_works_10(async); + => Assert.Equal( + SqliteStrings.AggregateOperationNotSupported("Min", "decimal"), + (await Assert.ThrowsAsync( + () => base.Min_Grouped_from_LINQ_101(async))).Message); + + public override async Task Whats_new_2021_sample_3(bool async) +#if DEBUG + // GroupBy debug assert. Issue #26104. + => Assert.StartsWith( + "Missing alias in the list", + (await Assert.ThrowsAsync( + () => base.Whats_new_2021_sample_3(async))).Message); +#else + => await base.Whats_new_2021_sample_3(async); +#endif + + public override async Task Whats_new_2021_sample_5(bool async) +#if DEBUG + // GroupBy debug assert. Issue #26104. + => Assert.StartsWith( + "Missing alias in the list", + (await Assert.ThrowsAsync( + () => base.Whats_new_2021_sample_5(async))).Message); +#else + => await base.Whats_new_2021_sample_5(async); +#endif + + public override async Task Whats_new_2021_sample_6(bool async) +#if DEBUG + // GroupBy debug assert. Issue #26104. + => Assert.StartsWith( + "Missing alias in the list", + (await Assert.ThrowsAsync( + () => base.Whats_new_2021_sample_6(async))).Message); +#else + => await base.Whats_new_2021_sample_6(async); +#endif public class Ef6GroupBySqliteFixture : Ef6GroupByFixtureBase {