-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from alexmurari/dev
Fix query parser not working with short name properties
- Loading branch information
Showing
14 changed files
with
173 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
namespace Exprelsior.Tests.QueryParser | ||
{ | ||
using System.Linq; | ||
using Xunit; | ||
|
||
/// <summary> | ||
/// Unit tests for the query parser. | ||
/// </summary> | ||
public class QueryParserTests | ||
{ | ||
/// <summary> | ||
/// Asserts that short name properties are correctly parsed by the query parser. | ||
/// </summary> | ||
/// <param name="propertyName">The property name to test.</param> | ||
[Theory] | ||
[InlineData("F")] | ||
[InlineData("Fo")] | ||
[InlineData("Foo")] | ||
public void Assert_Short_Name_Properties_Are_Parsed_Correctly(string propertyName) | ||
{ | ||
// Arrange | ||
var query = $"eq('{propertyName}', '1')"; | ||
|
||
// Act | ||
var queryElements = Exprelsior.DynamicQuery.Parser.QueryParser.ParseQuery(query).ToList(); | ||
|
||
// Assert | ||
Assert.NotEmpty(queryElements); | ||
Assert.Contains(queryElements, t => t.PropertyName == propertyName); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.