Skip to content

Commit

Permalink
Query: Re-enable few tests
Browse files Browse the repository at this point in the history
Resolves #17540
Resolves #22692
  • Loading branch information
smitpatel committed Sep 11, 2021
1 parent 647a6e1 commit 69a67ae
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,7 @@ protected override Expression VisitExtension(Expression extensionExpression)
case EntityShaperExpression entityShaperExpression:
return new EntityReferenceExpression(entityShaperExpression);

case ProjectionBindingExpression projectionBindingExpression
when projectionBindingExpression.ProjectionMember != null:
case ProjectionBindingExpression projectionBindingExpression:
return ((InMemoryQueryExpression)projectionBindingExpression.QueryExpression).GetProjection(projectionBindingExpression);

default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,15 @@ public override Task Client_member_and_unsupported_string_Equals_in_the_same_que
CoreStrings.QueryUnableToTranslateMember(nameof(Gear.IsMarcus), nameof(Gear)));
}

[ConditionalTheory(Skip = "issue #17540")]
public override Task
public override async Task
Null_semantics_is_correctly_applied_for_function_comparisons_that_take_arguments_from_optional_navigation_complex(bool async)
=> base.Null_semantics_is_correctly_applied_for_function_comparisons_that_take_arguments_from_optional_navigation_complex(
async);
{
Assert.Equal(
"Nullable object must have a value.",
(await Assert.ThrowsAsync<InvalidOperationException>(
() => base.Null_semantics_is_correctly_applied_for_function_comparisons_that_take_arguments_from_optional_navigation_complex(
async))).Message);
}

[ConditionalTheory(Skip = "issue #19683")]
public override Task Group_by_on_StartsWith_with_null_parameter_as_argument(bool async)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.Threading.Tasks;
using Xunit;

Expand All @@ -19,16 +20,14 @@ public override Task Distance_constant_lhs(bool async)
return base.Distance_constant_lhs(async);
}

[ConditionalTheory(Skip = "issue #19664")]
public override Task Intersects_equal_to_null(bool async)
{
return base.Intersects_equal_to_null(async);
return Assert.ThrowsAsync<NullReferenceException>(() => base.Intersects_equal_to_null(async));
}

[ConditionalTheory(Skip = "issue #19664")]
public override Task Intersects_not_equal_to_null(bool async)
{
return base.Intersects_not_equal_to_null(async);
return Assert.ThrowsAsync<NullReferenceException>(() => base.Intersects_not_equal_to_null(async));
}

public override Task GetGeometryN_with_null_argument(bool async)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// 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.Diagnostics;
using Microsoft.EntityFrameworkCore.TestUtilities;

namespace Microsoft.EntityFrameworkCore.Query
Expand All @@ -9,5 +10,12 @@ public abstract class ComplexNavigationsQueryRelationalFixtureBase : ComplexNavi
{
public TestSqlLoggerFactory TestSqlLoggerFactory
=> (TestSqlLoggerFactory)ListLoggerFactory;

public override DbContextOptionsBuilder AddOptions(DbContextOptionsBuilder builder)
=> base.AddOptions(builder).ConfigureWarnings(
c => c
.Log(CoreEventId.DistinctAfterOrderByWithoutRowLimitingOperatorWarning)
.Log(CoreEventId.FirstWithoutOrderByAndFilterWarning))
.EnableDetailedErrors();
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// 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.Diagnostics;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.EntityFrameworkCore.TestModels.ComplexNavigationsModel;
using Microsoft.EntityFrameworkCore.TestUtilities;
Expand All @@ -18,6 +19,12 @@ protected override void OnModelCreating(ModelBuilder modelBuilder, DbContext con

modelBuilder.Entity<Level1>(eb => eb.ToTable(nameof(Level1)));
}
public override DbContextOptionsBuilder AddOptions(DbContextOptionsBuilder builder)
=> base.AddOptions(builder).ConfigureWarnings(
c => c
.Log(CoreEventId.DistinctAfterOrderByWithoutRowLimitingOperatorWarning)
.Log(CoreEventId.FirstWithoutOrderByAndFilterWarning))
.EnableDetailedErrors();

protected override void Configure(OwnedNavigationBuilder<Level1, Level2> l2)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2764,7 +2764,7 @@ where l1.Id < 3
select l3).Distinct().OrderBy(l => l.Id).Skip(1).FirstOrDefault().Name);
}
[ConditionalTheory(Skip = "issue #8523")]
[ConditionalTheory]
[MemberData(nameof(IsAsyncData))]
public virtual Task Subquery_with_Distinct_Skip_FirstOrDefault_without_OrderBy(bool async)
{
Expand Down Expand Up @@ -3402,15 +3402,6 @@ public virtual void Join_with_navigations_in_the_result_selector2()
var result = query.ToList();
}
[ConditionalFact(Skip = "issue #12200")]
public virtual void GroupJoin_with_navigations_in_the_result_selector()
{
using var ctx = CreateContext();
var query = ctx.LevelOne.GroupJoin(
ctx.LevelTwo, l1 => l1.Id, l2 => l2.Level1_Required_Id, (o, i) => new { o.OneToOne_Optional_FK1, i });
var result = query.ToList();
}
[ConditionalFact]
public virtual void Member_pushdown_chain_3_levels_deep()
{
Expand Down Expand Up @@ -3607,7 +3598,7 @@ public virtual Task Sum_with_selector_cast_using_as(bool async)
ss => ss.Set<Level1>().Select(s => s.Id as int?));
}
[ConditionalTheory(Skip = "Issue#12657")]
[ConditionalTheory]
[MemberData(nameof(IsAsyncData))]
public virtual Task Sum_with_filter_with_include_selector_cast_using_as(bool async)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7885,7 +7885,7 @@ public virtual Task Cast_to_derived_followed_by_include_and_FirstOrDefault(bool

}

[ConditionalTheory(Skip = "issue #22692")]
[ConditionalTheory]
[MemberData(nameof(IsAsyncData))]
public virtual Task Cast_to_derived_followed_by_multiple_includes(bool async)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2526,7 +2526,16 @@ public override async Task Subquery_with_Distinct_Skip_FirstOrDefault_without_Or
await base.Subquery_with_Distinct_Skip_FirstOrDefault_without_OrderBy(async);

AssertSql(
"");
@"SELECT (
SELECT [t].[Name]
FROM (
SELECT DISTINCT [l0].[Id], [l0].[Level2_Optional_Id], [l0].[Level2_Required_Id], [l0].[Name], [l0].[OneToMany_Optional_Inverse3Id], [l0].[OneToMany_Optional_Self_Inverse3Id], [l0].[OneToMany_Required_Inverse3Id], [l0].[OneToMany_Required_Self_Inverse3Id], [l0].[OneToOne_Optional_PK_Inverse3Id], [l0].[OneToOne_Optional_Self3Id]
FROM [LevelThree] AS [l0]
) AS [t]
ORDER BY (SELECT 1)
OFFSET 1 ROWS FETCH NEXT 1 ROWS ONLY)
FROM [LevelOne] AS [l]
WHERE [l].[Id] < 3");
}

public override async Task Project_collection_navigation_count(bool async)
Expand Down Expand Up @@ -3106,14 +3115,6 @@ FROM [LevelOne] AS [l]
ORDER BY [l].[Id], [l0].[Id], [l1].[Id]");
}

public override void GroupJoin_with_navigations_in_the_result_selector()
{
base.GroupJoin_with_navigations_in_the_result_selector();

AssertSql(
@"");
}

public override void Member_pushdown_chain_3_levels_deep()
{
base.Member_pushdown_chain_3_levels_deep();
Expand Down Expand Up @@ -3336,14 +3337,12 @@ public override async Task Sum_with_filter_with_include_selector_cast_using_as(b
await base.Sum_with_filter_with_include_selector_cast_using_as(async);

AssertSql(
@"SELECT [l].[Id], [l].[Date], [l].[Name], [l].[OneToMany_Optional_Self_Inverse1Id], [l].[OneToMany_Required_Self_Inverse1Id], [l].[OneToOne_Optional_Self1Id], [l0].[Id], [l0].[Date], [l0].[Level1_Optional_Id], [l0].[Level1_Required_Id], [l0].[Name], [l0].[OneToMany_Optional_Inverse2Id], [l0].[OneToMany_Optional_Self_Inverse2Id], [l0].[OneToMany_Required_Inverse2Id], [l0].[OneToMany_Required_Self_Inverse2Id], [l0].[OneToOne_Optional_PK_Inverse2Id], [l0].[OneToOne_Optional_Self2Id]
@"SELECT [l].[Id], [l].[Date], [l].[Name], [l].[OneToMany_Optional_Self_Inverse1Id], [l].[OneToMany_Required_Self_Inverse1Id], [l].[OneToOne_Optional_Self1Id]
FROM [LevelOne] AS [l]
LEFT JOIN [LevelTwo] AS [l0] ON [l].[Id] = [l0].[OneToMany_Optional_Inverse2Id]
WHERE [l].[Id] > (
SELECT SUM([l1].[Id])
FROM [LevelTwo] AS [l1]
WHERE [l].[Id] = [l1].[OneToMany_Optional_Inverse2Id])
ORDER BY [l].[Id], [l0].[Id]");
SELECT COALESCE(SUM([l0].[Id]), 0)
FROM [LevelTwo] AS [l0]
WHERE [l].[Id] = [l0].[OneToMany_Optional_Inverse2Id])");
}

public override async Task Select_with_joined_where_clause_cast_using_as(bool async)
Expand Down

0 comments on commit 69a67ae

Please sign in to comment.