From 3c9432ef005135e01e3747e40185b67264701654 Mon Sep 17 00:00:00 2001 From: maumar Date: Mon, 2 Aug 2021 15:43:10 -0700 Subject: [PATCH] Enabling some Distinct tests on Cosmos Resolves #16144 --- ...thwindAggregateOperatorsQueryCosmosTest.cs | 29 +++++++++---------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/test/EFCore.Cosmos.FunctionalTests/Query/NorthwindAggregateOperatorsQueryCosmosTest.cs b/test/EFCore.Cosmos.FunctionalTests/Query/NorthwindAggregateOperatorsQueryCosmosTest.cs index 0fc7de78b7c..17bb8c00349 100644 --- a/test/EFCore.Cosmos.FunctionalTests/Query/NorthwindAggregateOperatorsQueryCosmosTest.cs +++ b/test/EFCore.Cosmos.FunctionalTests/Query/NorthwindAggregateOperatorsQueryCosmosTest.cs @@ -1,9 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System.Linq; -using System.Runtime.CompilerServices; -using System.Threading.Tasks; using Microsoft.EntityFrameworkCore.TestModels.Northwind; using Microsoft.EntityFrameworkCore.TestUtilities; using Xunit; @@ -772,41 +769,41 @@ FROM root c WHERE (c[""Discriminator""] = ""Employee"")"); } - [ConditionalTheory(Skip = "Issue#16144")] + [ConditionalTheory] public override async Task Distinct(bool async) { await base.Distinct(async); AssertSql( - @"SELECT c + @"SELECT DISTINCT c FROM root c WHERE (c[""Discriminator""] = ""Customer"")"); } - [ConditionalTheory(Skip = "Issue#16144")] + [ConditionalTheory] public override async Task Distinct_Scalar(bool async) { await base.Distinct_Scalar(async); AssertSql( - @"SELECT c + @"SELECT DISTINCT c[""City""] FROM root c WHERE (c[""Discriminator""] = ""Customer"")"); } - [ConditionalTheory(Skip = "Issue#16144")] + [ConditionalTheory] public override async Task OrderBy_Distinct(bool async) { await base.OrderBy_Distinct(async); - // Ordering not preserved by distinct when ordering columns not projected. AssertSql( - @"SELECT c + @"SELECT DISTINCT c[""City""] FROM root c -WHERE (c[""Discriminator""] = ""Customer"")"); +WHERE (c[""Discriminator""] = ""Customer"") +ORDER BY c[""CustomerID""]"); } - [ConditionalTheory(Skip = "Issue#16144")] + [ConditionalTheory(Skip = "Issue#16156")] public override async Task Distinct_OrderBy(bool async) { await base.Distinct_OrderBy(async); @@ -817,7 +814,7 @@ FROM root c WHERE (c[""Discriminator""] = ""Customer"")"); } - [ConditionalTheory(Skip = "Issue#16144")] + [ConditionalTheory(Skip = "Issue#16156")] public override async Task Distinct_OrderBy2(bool async) { await base.Distinct_OrderBy2(async); @@ -828,7 +825,7 @@ FROM root c WHERE (c[""Discriminator""] = ""Customer"")"); } - [ConditionalTheory(Skip = "Issue#16144")] + [ConditionalTheory(Skip = "Issue#16156")] public override async Task Distinct_OrderBy3(bool async) { await base.Distinct_OrderBy3(async); @@ -839,7 +836,7 @@ FROM root c WHERE (c[""Discriminator""] = ""Customer"")"); } - [ConditionalTheory(Skip = "Issue#16144")] + [ConditionalTheory(Skip = "Issue#16156")] public override async Task Distinct_Count(bool async) { await base.Distinct_Count(async); @@ -850,7 +847,7 @@ FROM root c WHERE (c[""Discriminator""] = ""Customer"")"); } - [ConditionalTheory(Skip = "Issue#16144")] + [ConditionalTheory(Skip = "Issue#16156")] public override async Task Select_Select_Distinct_Count(bool async) { await base.Select_Select_Distinct_Count(async);