Skip to content

Commit 3de19b9

Browse files
Copilotcincuranet
andcommitted
Add additional test for IQueryable == null scenario
Co-authored-by: cincuranet <[email protected]>
1 parent b9a9722 commit 3de19b9

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/EFCore.Specification.Tests/Query/NorthwindWhereQueryTestBase.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1430,6 +1430,19 @@ public virtual Task Where_Queryable_null_check_with_Contains(bool async)
14301430
});
14311431
}
14321432

1433+
[ConditionalTheory, MemberData(nameof(IsAsyncData))]
1434+
public virtual Task Where_Queryable_null_check_equal(bool async)
1435+
{
1436+
return AssertQuery(
1437+
async,
1438+
ss =>
1439+
{
1440+
var ids = ss.Set<Customer>().Select(c => c.CustomerID);
1441+
return ss.Set<Customer>().Where(c => ids == null || !ids.Contains(c.CustomerID));
1442+
},
1443+
assertEmpty: true);
1444+
}
1445+
14331446
[ConditionalTheory, MemberData(nameof(IsAsyncData))]
14341447
public virtual Task Where_Queryable_ToList_Count_member(bool async)
14351448
=> AssertQuery(

0 commit comments

Comments
 (0)