Skip to content

Commit

Permalink
Add test for projected Contains(null) (#25893)
Browse files Browse the repository at this point in the history
Closes #19702
  • Loading branch information
roji authored Sep 6, 2021
1 parent f3c82b6 commit a0bb25f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1398,6 +1398,12 @@ public override Task Contains_over_entityType_with_null_should_rewrite_to_false(
return base.Contains_over_entityType_with_null_should_rewrite_to_false(async);
}

[ConditionalTheory(Skip = "Issue#17246 (Contains over subquery is not supported)")]
public override Task Contains_over_entityType_with_null_in_projection(bool async)
{
return base.Contains_over_entityType_with_null_in_projection(async);
}

public override async Task String_FirstOrDefault_in_projection_does_not_do_client_eval(bool async)
{
await base.String_FirstOrDefault_in_projection_does_not_do_client_eval(async);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1579,6 +1579,17 @@ public virtual Task Contains_over_entityType_with_null_should_rewrite_to_identit
ss => ss.Set<Order>().Where(o => ss.Set<Order>().Where(o => o.CustomerID == "VINET").Contains(null)));
}

[ConditionalTheory]
[MemberData(nameof(IsAsyncData))]
public virtual Task Contains_over_entityType_with_null_in_projection(bool async)
{
return AssertQuery(
async,
ss => ss.Set<Order>().Where(
o => ss.Set<Order>().Where(o => o.CustomerID == "VINET")
.Contains(null)));
}

[ConditionalTheory]
[MemberData(nameof(IsAsyncData))]
public virtual Task Contains_over_scalar_with_null_should_rewrite_to_identity_equality_subquery(bool async)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1177,6 +1177,16 @@ FROM [Orders] AS [o]
WHERE 0 = 1");
}

public override async Task Contains_over_entityType_with_null_in_projection(bool async)
{
await base.Contains_over_entityType_with_null_in_projection(async);

AssertSql(
@"SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate]
FROM [Orders] AS [o]
WHERE 0 = 1");
}

public override async Task Contains_over_scalar_with_null_should_rewrite_to_identity_equality_subquery(bool async)
{
await base.Contains_over_scalar_with_null_should_rewrite_to_identity_equality_subquery(async);
Expand Down

0 comments on commit a0bb25f

Please sign in to comment.