Skip to content

Commit dc04bc0

Browse files
committed
Uncomment tests using optional parameters in LINQ
Update to dotnet SDK 10.0.100-preview.5.25258.31, which contains the fix for dotnet/csharplang#9246. This reverts commit 4f8ea72. Fixes #35547
1 parent 29c055e commit dc04bc0

23 files changed

+1541
-1706
lines changed

test/EFCore.Cosmos.FunctionalTests/Query/NorthwindAggregateOperatorsQueryCosmosTest.cs

Lines changed: 38 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1442,32 +1442,29 @@ WHERE ARRAY_CONTAINS(@ids, c["EmployeeID"])
14421442
""");
14431443
});
14441444

1445-
// TODO: The base implementations no longer compile since https://github.com/dotnet/runtime/pull/110197 (Contains overload added with
1446-
// optional parameter, not supported in expression trees). #35547 is tracking on the EF side.
1447-
//
1448-
// public override Task Contains_with_local_nullable_uint_array_closure(bool async)
1449-
// => Fixture.NoSyncTest(
1450-
// async, async a =>
1451-
// {
1452-
// await base.Contains_with_local_nullable_uint_array_closure(a);
1453-
//
1454-
// AssertSql(
1455-
// """
1456-
// @ids='[0,1]'
1457-
//
1458-
// SELECT VALUE c
1459-
// FROM root c
1460-
// WHERE ARRAY_CONTAINS(@ids, c["EmployeeID"])
1461-
// """,
1462-
// //
1463-
// """
1464-
// @ids='[0]'
1465-
//
1466-
// SELECT VALUE c
1467-
// FROM root c
1468-
// WHERE ARRAY_CONTAINS(@ids, c["EmployeeID"])
1469-
// """);
1470-
// });
1445+
public override Task Contains_with_local_nullable_uint_array_closure(bool async)
1446+
=> Fixture.NoSyncTest(
1447+
async, async a =>
1448+
{
1449+
await base.Contains_with_local_nullable_uint_array_closure(a);
1450+
1451+
AssertSql(
1452+
"""
1453+
@ids='[0,1]'
1454+
1455+
SELECT VALUE c
1456+
FROM root c
1457+
WHERE ARRAY_CONTAINS(@ids, c["EmployeeID"])
1458+
""",
1459+
//
1460+
"""
1461+
@ids='[0]'
1462+
1463+
SELECT VALUE c
1464+
FROM root c
1465+
WHERE ARRAY_CONTAINS(@ids, c["EmployeeID"])
1466+
""");
1467+
});
14711468

14721469
public override Task Contains_with_local_array_inline(bool async)
14731470
=> Fixture.NoSyncTest(
@@ -2007,25 +2004,21 @@ FROM root c
20072004
}
20082005
}
20092006

2010-
// TODO: The base implementations no longer compile since https://github.com/dotnet/runtime/pull/110197 (Contains overload added with
2011-
// optional parameter, not supported in expression trees). #35547 is tracking on the EF side.
2012-
//
2013-
//
2014-
// public override async Task Contains_with_local_tuple_array_closure(bool async)
2015-
// {
2016-
// // Contains over subquery. Issue #17246.
2017-
// await AssertTranslationFailed(() => base.Contains_with_local_tuple_array_closure(async));
2018-
//
2019-
// AssertSql();
2020-
// }
2021-
//
2022-
// public override async Task Contains_with_local_anonymous_type_array_closure(bool async)
2023-
// {
2024-
// // Contains over subquery. Issue #17246.
2025-
// await AssertTranslationFailed(() => base.Contains_with_local_anonymous_type_array_closure(async));
2026-
//
2027-
// AssertSql();
2028-
// }
2007+
public override async Task Contains_with_local_tuple_array_closure(bool async)
2008+
{
2009+
// Contains over subquery. Issue #17246.
2010+
await AssertTranslationFailed(() => base.Contains_with_local_tuple_array_closure(async));
2011+
2012+
AssertSql();
2013+
}
2014+
2015+
public override async Task Contains_with_local_anonymous_type_array_closure(bool async)
2016+
{
2017+
// Contains over subquery. Issue #17246.
2018+
await AssertTranslationFailed(() => base.Contains_with_local_anonymous_type_array_closure(async));
2019+
2020+
AssertSql();
2021+
}
20292022

20302023
public override async Task OfType_Select(bool async)
20312024
{

test/EFCore.Cosmos.FunctionalTests/Query/NorthwindWhereQueryCosmosTest.cs

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1627,16 +1627,13 @@ public override async Task Where_collection_navigation_ToArray_Count(bool async)
16271627
AssertSql();
16281628
}
16291629

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

16411638
public override async Task Where_collection_navigation_AsEnumerable_Count(bool async)
16421639
{
@@ -1694,24 +1691,21 @@ FROM root c
16941691
""");
16951692
});
16961693

1697-
// TODO: The base implementations no longer compile since https://github.com/dotnet/runtime/pull/110197 (Contains overload added with
1698-
// optional parameter, not supported in expression trees). #35547 is tracking on the EF side.
1699-
//
1700-
// public override Task Where_array_of_object_contains_over_value_type(bool async)
1701-
// => Fixture.NoSyncTest(
1702-
// async, async a =>
1703-
// {
1704-
// await base.Where_array_of_object_contains_over_value_type(a);
1705-
//
1706-
// AssertSql(
1707-
// """
1708-
// @orderIds='[10248,10249]'
1709-
//
1710-
// SELECT VALUE c
1711-
// FROM root c
1712-
// WHERE ((c["$type"] = "Order") AND ARRAY_CONTAINS(@orderIds, c["OrderID"]))
1713-
// """);
1714-
// });
1694+
public override Task Where_array_of_object_contains_over_value_type(bool async)
1695+
=> Fixture.NoSyncTest(
1696+
async, async a =>
1697+
{
1698+
await base.Where_array_of_object_contains_over_value_type(a);
1699+
1700+
AssertSql(
1701+
"""
1702+
@orderIds='[10248,10249]'
1703+
1704+
SELECT VALUE c
1705+
FROM root c
1706+
WHERE ((c["$type"] = "Order") AND ARRAY_CONTAINS(@orderIds, c["OrderID"]))
1707+
""");
1708+
});
17151709

17161710
public override Task Filter_with_EF_Property_using_closure_for_property_name(bool async)
17171711
=> Fixture.NoSyncTest(

0 commit comments

Comments
 (0)