Skip to content

Uncomment tests using optional parameters in LINQ #36057

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1442,32 +1442,29 @@ WHERE ARRAY_CONTAINS(@ids, c["EmployeeID"])
""");
});

// TODO: The base implementations no longer compile since https://github.com/dotnet/runtime/pull/110197 (Contains overload added with
// optional parameter, not supported in expression trees). #35547 is tracking on the EF side.
//
// public override Task Contains_with_local_nullable_uint_array_closure(bool async)
// => Fixture.NoSyncTest(
// async, async a =>
// {
// await base.Contains_with_local_nullable_uint_array_closure(a);
//
// AssertSql(
// """
// @ids='[0,1]'
//
// SELECT VALUE c
// FROM root c
// WHERE ARRAY_CONTAINS(@ids, c["EmployeeID"])
// """,
// //
// """
// @ids='[0]'
//
// SELECT VALUE c
// FROM root c
// WHERE ARRAY_CONTAINS(@ids, c["EmployeeID"])
// """);
// });
public override Task Contains_with_local_nullable_uint_array_closure(bool async)
=> Fixture.NoSyncTest(
async, async a =>
{
await base.Contains_with_local_nullable_uint_array_closure(a);

AssertSql(
"""
@ids='[0,1]'

SELECT VALUE c
FROM root c
WHERE ARRAY_CONTAINS(@ids, c["EmployeeID"])
""",
//
"""
@ids='[0]'

SELECT VALUE c
FROM root c
WHERE ARRAY_CONTAINS(@ids, c["EmployeeID"])
""");
});

public override Task Contains_with_local_array_inline(bool async)
=> Fixture.NoSyncTest(
Expand Down Expand Up @@ -2007,25 +2004,21 @@ FROM root c
}
}

// TODO: The base implementations no longer compile since https://github.com/dotnet/runtime/pull/110197 (Contains overload added with
// optional parameter, not supported in expression trees). #35547 is tracking on the EF side.
//
//
// public override async Task Contains_with_local_tuple_array_closure(bool async)
// {
// // Contains over subquery. Issue #17246.
// await AssertTranslationFailed(() => base.Contains_with_local_tuple_array_closure(async));
//
// AssertSql();
// }
//
// public override async Task Contains_with_local_anonymous_type_array_closure(bool async)
// {
// // Contains over subquery. Issue #17246.
// await AssertTranslationFailed(() => base.Contains_with_local_anonymous_type_array_closure(async));
//
// AssertSql();
// }
public override async Task Contains_with_local_tuple_array_closure(bool async)
{
// Contains over subquery. Issue #17246.
await AssertTranslationFailed(() => base.Contains_with_local_tuple_array_closure(async));

AssertSql();
}

public override async Task Contains_with_local_anonymous_type_array_closure(bool async)
{
// Contains over subquery. Issue #17246.
await AssertTranslationFailed(() => base.Contains_with_local_anonymous_type_array_closure(async));

AssertSql();
}

public override async Task OfType_Select(bool async)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1627,16 +1627,13 @@ public override async Task Where_collection_navigation_ToArray_Count(bool async)
AssertSql();
}

// TODO: The base implementations no longer compile since https://github.com/dotnet/runtime/pull/110197 (Contains overload added with
// optional parameter, not supported in expression trees). #35547 is tracking on the EF side.
//
// public override async Task Where_collection_navigation_ToArray_Contains(bool async)
// {
// // Cosmos client evaluation. Issue #17246.
// await AssertTranslationFailed(() => base.Where_collection_navigation_ToArray_Contains(async));
//
// AssertSql();
// }
public override async Task Where_collection_navigation_ToArray_Contains(bool async)
{
// Cosmos client evaluation. Issue #17246.
await AssertTranslationFailed(() => base.Where_collection_navigation_ToArray_Contains(async));

AssertSql();
}

public override async Task Where_collection_navigation_AsEnumerable_Count(bool async)
{
Expand Down Expand Up @@ -1694,24 +1691,21 @@ FROM root c
""");
});

// TODO: The base implementations no longer compile since https://github.com/dotnet/runtime/pull/110197 (Contains overload added with
// optional parameter, not supported in expression trees). #35547 is tracking on the EF side.
//
// public override Task Where_array_of_object_contains_over_value_type(bool async)
// => Fixture.NoSyncTest(
// async, async a =>
// {
// await base.Where_array_of_object_contains_over_value_type(a);
//
// AssertSql(
// """
// @orderIds='[10248,10249]'
//
// SELECT VALUE c
// FROM root c
// WHERE ((c["$type"] = "Order") AND ARRAY_CONTAINS(@orderIds, c["OrderID"]))
// """);
// });
public override Task Where_array_of_object_contains_over_value_type(bool async)
=> Fixture.NoSyncTest(
async, async a =>
{
await base.Where_array_of_object_contains_over_value_type(a);

AssertSql(
"""
@orderIds='[10248,10249]'

SELECT VALUE c
FROM root c
WHERE ((c["$type"] = "Order") AND ARRAY_CONTAINS(@orderIds, c["OrderID"]))
""");
});

public override Task Filter_with_EF_Property_using_closure_for_property_name(bool async)
=> Fixture.NoSyncTest(
Expand Down
Loading
Loading