From a95891737cd4a867cbe3417b22857a8180e1ed91 Mon Sep 17 00:00:00 2001 From: Christopher Jolly Date: Sun, 3 Mar 2024 19:37:31 +0800 Subject: [PATCH] add some test fixes --- .../NorthwindMiscellaneousQueryJetTest.cs | 54 ++++++------------- .../Query/NorthwindSelectQueryJetTest.cs | 10 ++-- 2 files changed, 22 insertions(+), 42 deletions(-) diff --git a/test/EFCore.Jet.FunctionalTests/Query/NorthwindMiscellaneousQueryJetTest.cs b/test/EFCore.Jet.FunctionalTests/Query/NorthwindMiscellaneousQueryJetTest.cs index f3a7c78..09f6f8a 100644 --- a/test/EFCore.Jet.FunctionalTests/Query/NorthwindMiscellaneousQueryJetTest.cs +++ b/test/EFCore.Jet.FunctionalTests/Query/NorthwindMiscellaneousQueryJetTest.cs @@ -6811,43 +6811,23 @@ WHERE ( public override async Task Parameter_collection_Contains_with_projection_and_ordering(bool async) { -#if DEBUG - // GroupBy debug assert. Issue #26104. - Assert.StartsWith( - "Missing alias in the list", - (await Assert.ThrowsAsync( - () => base.Parameter_collection_Contains_with_projection_and_ordering(async))).Message); -#else - await base.Parameter_collection_Contains_with_projection_and_ordering(async); - - AssertSql( - """ -@__ids_0='[10248,10249]' (Size = 4000) - -SELECT [o].[Quantity] AS [Key], ( - SELECT MAX([o3].[OrderDate]) - FROM [Order Details] AS [o2] - INNER JOIN [Orders] AS [o3] ON [o2].[OrderID] = [o3].[OrderID] - WHERE [o2].[OrderID] IN ( - SELECT [i1].[value] - FROM OPENJSON(@__ids_0) WITH ([value] int '$') AS [i1] - ) AND [o].[Quantity] = [o2].[Quantity]) AS [MaxTimestamp] -FROM [Order Details] AS [o] -WHERE [o].[OrderID] IN ( - SELECT [i].[value] - FROM OPENJSON(@__ids_0) WITH ([value] int '$') AS [i] -) -GROUP BY [o].[Quantity] -ORDER BY ( - SELECT MAX([o3].[OrderDate]) - FROM [Order Details] AS [o2] - INNER JOIN [Orders] AS [o3] ON [o2].[OrderID] = [o3].[OrderID] - WHERE [o2].[OrderID] IN ( - SELECT [i0].[value] - FROM OPENJSON(@__ids_0) WITH ([value] int '$') AS [i0] - ) AND [o].[Quantity] = [o2].[Quantity]) -"""); -#endif + await base.Parameter_collection_Contains_with_projection_and_ordering(async); + + AssertSql( + """ +SELECT `t`.`Key`, `t`.`MaxTimestamp` +FROM ( + SELECT `o`.`Quantity` AS `Key`, ( + SELECT MAX(`o3`.`OrderDate`) + FROM `Order Details` AS `o2` + INNER JOIN `Orders` AS `o3` ON `o2`.`OrderID` = `o3`.`OrderID` + WHERE `o2`.`OrderID` IN (10248, 10249) AND `o`.`Quantity` = `o2`.`Quantity`) AS `MaxTimestamp` + FROM `Order Details` AS `o` + WHERE `o`.`OrderID` IN (10248, 10249) + GROUP BY `o`.`Quantity` +) AS `t` +ORDER BY `t`.`MaxTimestamp` +"""); } private void AssertSql(params string[] expected) diff --git a/test/EFCore.Jet.FunctionalTests/Query/NorthwindSelectQueryJetTest.cs b/test/EFCore.Jet.FunctionalTests/Query/NorthwindSelectQueryJetTest.cs index fe7eff9..70566f2 100644 --- a/test/EFCore.Jet.FunctionalTests/Query/NorthwindSelectQueryJetTest.cs +++ b/test/EFCore.Jet.FunctionalTests/Query/NorthwindSelectQueryJetTest.cs @@ -1262,12 +1262,12 @@ CROSS APPLY ( SelectMany_with_collection_being_correlated_subquery_which_references_non_mapped_properties_from_inner_and_outer_entity( bool isAsync) { - await base - .SelectMany_with_collection_being_correlated_subquery_which_references_non_mapped_properties_from_inner_and_outer_entity( - isAsync); + await AssertUnableToTranslateEFProperty( + () => base + .SelectMany_with_collection_being_correlated_subquery_which_references_non_mapped_properties_from_inner_and_outer_entity( + isAsync)); - AssertSql( - $@""); + AssertSql(); } public override async Task Select_with_complex_expression_that_can_be_funcletized(bool isAsync)