diff --git a/test/EFCore.InMemory.FunctionalTests/Query/Ef6GroupByInMemoryTest.cs b/test/EFCore.InMemory.FunctionalTests/Query/Ef6GroupByInMemoryTest.cs index d88e1c0b6ca..3301386a2cd 100644 --- a/test/EFCore.InMemory.FunctionalTests/Query/Ef6GroupByInMemoryTest.cs +++ b/test/EFCore.InMemory.FunctionalTests/Query/Ef6GroupByInMemoryTest.cs @@ -10,15 +10,6 @@ public Ef6GroupByInMemoryTest(Ef6GroupByInMemoryFixture fixture, ITestOutputHelp { } - public override Task Average_Grouped_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, AveragePrice = g.Average(p => p.UnitPrice) }, - elementSorter: e => (e.Category, e.AveragePrice)); - 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 4444308f5c1..21233859eeb 100644 --- a/test/EFCore.Specification.Tests/Query/Ef6GroupByTestBase.cs +++ b/test/EFCore.Specification.Tests/Query/Ef6GroupByTestBase.cs @@ -410,11 +410,12 @@ public virtual Task Average_Grouped_from_LINQ_101(bool async) group p by p.Category into g select new { Category = g.Key, AveragePrice = g.Average(p => p.UnitPrice) }, - 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) }, - elementSorter: e => (e.Category, e.AveragePrice)); + elementSorter: e => (e.Category, e.AveragePrice), + elementAsserter: (e, a) => + { + AssertEqual(e.Category, a.Category); + Assert.InRange(a.AveragePrice, e.AveragePrice - 0.00005m, e.AveragePrice + 0.00005m); + }); [ConditionalTheory] [MemberData(nameof(IsAsyncData))] @@ -644,7 +645,7 @@ in temp Assert.Equal(l.Id, r.Id); Assert.Equal(l.Age, r.Age); Assert.Equal(l.Style, r.Style); - Assert.Equal(l.Values, r.Values); + AssertCollection(l.Values, r.Values, elementSorter: e => (e.Id, e.Style, e.Age)); }); [ConditionalTheory] // From #19506