From da37afaf406b5fd71d4998dbafc1f95ef0e8880b Mon Sep 17 00:00:00 2001 From: "Jeremy D. Miller" Date: Wed, 21 Feb 2024 14:38:20 -0600 Subject: [PATCH] Test to prove an open bug is fixed. Closes GH-2980 --- ...Bug_using_literal_false_in_where_clause.cs | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/LinqTests/Bugs/Bug_using_literal_false_in_where_clause.cs b/src/LinqTests/Bugs/Bug_using_literal_false_in_where_clause.cs index d695c1fb00..1ce248f3d2 100644 --- a/src/LinqTests/Bugs/Bug_using_literal_false_in_where_clause.cs +++ b/src/LinqTests/Bugs/Bug_using_literal_false_in_where_clause.cs @@ -48,6 +48,31 @@ public async Task return_correct_results() actual.ShouldBeEmpty(); } + + [Fact] + public async Task Bug_2980() + { + var aggregate1 = new DeletableAggregate + { + Id = Guid.NewGuid(), + Deleted = true, + }; + theSession.Store(aggregate1); + var aggregate2 = new DeletableAggregate + { + Id = Guid.NewGuid(), + Deleted = false, + }; + theSession.Store(aggregate2); + await theSession.SaveChangesAsync(); + + var actual = await theSession + .Query() + .Where(x => false) + .ToListAsync(); + + actual.ShouldBeEmpty(); + } } public class DeletableAggregate: ISoftDeleted