diff --git a/test/EFCore.InMemory.FunctionalTests/Query/Ef6GroupByInMemoryTest.cs b/test/EFCore.InMemory.FunctionalTests/Query/Ef6GroupByInMemoryTest.cs index fa6c6cec4df..d88e1c0b6ca 100644 --- a/test/EFCore.InMemory.FunctionalTests/Query/Ef6GroupByInMemoryTest.cs +++ b/test/EFCore.InMemory.FunctionalTests/Query/Ef6GroupByInMemoryTest.cs @@ -16,7 +16,8 @@ public override Task Average_Grouped_from_LINQ_101(bool async) ss => from p in ss.Set() group p by p.Category into g - select new { Category = g.Key, AveragePrice = g.Average(p => p.UnitPrice) }); + select new { Category = g.Key, AveragePrice = g.Average(p => p.UnitPrice) }, + elementSorter: e => (e.Category, e.AveragePrice)); public class Ef6GroupByInMemoryFixture : Ef6GroupByFixtureBase { diff --git a/test/EFCore.Specification.Tests/Query/Ef6GroupByTestBase.cs b/test/EFCore.Specification.Tests/Query/Ef6GroupByTestBase.cs index 46987ca8e17..fe48a09a953 100644 --- a/test/EFCore.Specification.Tests/Query/Ef6GroupByTestBase.cs +++ b/test/EFCore.Specification.Tests/Query/Ef6GroupByTestBase.cs @@ -413,7 +413,8 @@ into g ss => from p in ss.Set() group p by p.Category into g - select new { Category = g.Key, AveragePrice = Math.Round(g.Average(p => p.UnitPrice) - 0.0000005m, 6) }); + select new { Category = g.Key, AveragePrice = Math.Round(g.Average(p => p.UnitPrice) - 0.0000005m, 6) }, + elementSorter: e => (e.Category, e.AveragePrice)); [ConditionalTheory] [MemberData(nameof(IsAsyncData))] diff --git a/test/EFCore.Specification.Tests/Query/NorthwindSelectQueryTestBase.cs b/test/EFCore.Specification.Tests/Query/NorthwindSelectQueryTestBase.cs index b219f7b62bc..638ac978283 100644 --- a/test/EFCore.Specification.Tests/Query/NorthwindSelectQueryTestBase.cs +++ b/test/EFCore.Specification.Tests/Query/NorthwindSelectQueryTestBase.cs @@ -846,7 +846,7 @@ public virtual Task Reverse_in_subquery_via_pushdown(bool async) .Take(5) .Distinct() .Select(e => new { e.EmployeeID, e.City }), - assertOrder: true); + elementSorter: e => e.EmployeeID); [ConditionalTheory] [MemberData(nameof(IsAsyncData))] diff --git a/test/EFCore.Specification.Tests/Query/SimpleQueryTestBase.cs b/test/EFCore.Specification.Tests/Query/SimpleQueryTestBase.cs index f9f6fa1f9c3..c40d411f8e5 100644 --- a/test/EFCore.Specification.Tests/Query/SimpleQueryTestBase.cs +++ b/test/EFCore.Specification.Tests/Query/SimpleQueryTestBase.cs @@ -771,9 +771,21 @@ public virtual async Task Aggregate_over_subquery_in_group_by_projection(bool as ? await query.ToListAsync() : query.ToList(); - Assert.Collection(orders, - t => Assert.Equal(10, t.CustomerMinHourlyRate), - t => Assert.Equal(20, t.CustomerMinHourlyRate)); + Assert.Collection(orders.OrderBy(x => x.CustomerId), + t => + { + Assert.Equal(1, t.CustomerId); + Assert.Equal(10, t.CustomerMinHourlyRate); + Assert.Equal(11, t.HourlyRate); + Assert.Equal(1, t.Count); + }, + t => + { + Assert.Equal(2, t.CustomerId); + Assert.Equal(20, t.CustomerMinHourlyRate); + Assert.Equal(20, t.HourlyRate); + Assert.Equal(1, t.Count); + }); } protected class Context27083 : DbContext