Skip to content

Commit

Permalink
Where_Dynamic_ConcatString (#809)
Browse files Browse the repository at this point in the history
  • Loading branch information
StefH authored May 1, 2024
1 parent 74da34f commit cb77861
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/System.Linq.Dynamic.Core.Tests/QueryableTests.Where.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,23 @@ public void Where_Dynamic_StringQuoted()
Assert.Equal(expected, result2b);
}

[Fact]
public void Where_Dynamic_ConcatString()
{
// Arrange
var qry = User.GenerateSampleModels(2).AsQueryable();

// Act
var expected = qry.Where(u => (u.UserName + u.UserName).Length > 10).ToArray();

var result1 = qry.Where("(UserName + UserName).Length > 10").ToArray();
var result2 = qry.Where("u => (u.UserName + u.UserName).Length > 10").ToArray();

// Assert
result1.Should().BeEquivalentTo(expected);
result2.Should().BeEquivalentTo(expected);
}

[Fact]
public void Where_Dynamic_EmptyString()
{
Expand Down

0 comments on commit cb77861

Please sign in to comment.