Skip to content
Open
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
22 changes: 22 additions & 0 deletions test/Redis.OM.Unit.Tests/RediSearchTests/SearchTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4356,6 +4356,28 @@ await _substitute.Received().ExecuteAsync("FT.SEARCH",
"100");
}

[Fact]
public void TestContainsOnNullableSearchableStringWithSelectAndNotNull()
{
_substitute.ClearSubstitute();
_substitute.Execute(Arg.Any<string>(), Arg.Any<object[]>()).Returns(_mockReply);

var collection = new RedisCollection<ObjectWithNullableStrings>(_substitute);
var queryString = collection
.Where(x => x.String2 != null && x.String2.Contains("Fal"))
.Select(x => new ObjectWithNullableStrings
{
Id = x.Id,
String2 = x.String2
})
.Take(11)
.ToQueryString();

Assert.Equal(
"\"FT.SEARCH\" \"objectwithnullablestrings-idx\" \"(-(ismissing(@String2)) (@String2:Fal))\" \"DIALECT\" \"2\" \"LIMIT\" \"0\" \"11\" \"RETURN\" \"6\" \"Id\" \"AS\" \"Id\" \"String2\" \"AS\" \"String2\"",
queryString);
}

[Fact]
public async Task TestIsNotNull()
{
Expand Down
Loading