Skip to content

Commit 7c7e1c6

Browse files
committed
build: extra test
1 parent 847eca1 commit 7c7e1c6

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

QueryKit.IntegrationTests/Tests/DatabaseFilteringTests.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,30 @@ public async Task can_filter_by_nullable_guid_contains()
455455
people.Count.Should().Be(1);
456456
people[0].Id.Should().Be(fakeRecipeOne.Id);
457457
}
458+
459+
[Fact]
460+
public async Task can_filter_by_nullable_guid_is_something()
461+
{
462+
// Arrange
463+
var testingServiceScope = new TestingServiceScope();
464+
var fakeRecipeOne = new FakeRecipeBuilder().Build();
465+
var fakeRecipeTwo = new FakeRecipeBuilder().Build();
466+
await testingServiceScope.InsertAsync(fakeRecipeOne, fakeRecipeTwo);
467+
468+
var input = $"""(secondaryId == "{fakeRecipeTwo.SecondaryId}")""";
469+
470+
// Act
471+
var queryableRecipe = testingServiceScope.DbContext().Recipes;
472+
var appliedQueryable = queryableRecipe.ApplyQueryKitFilter(input);
473+
var people = await appliedQueryable.ToListAsync();
474+
// var people = testingServiceScope.DbContext().Recipes
475+
// .Where(x => x.SecondaryId.ToString() == null)
476+
// .ToList();
477+
478+
// Assert
479+
people.Count.Should().Be(1);
480+
people[0].Id.Should().Be(fakeRecipeTwo.Id);
481+
}
458482

459483
[Fact]
460484
public async Task return_no_records_when_no_match()

0 commit comments

Comments
 (0)