-
-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Adds support for decimal qualifiers. Resolves #91 #92
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -656,6 +656,38 @@ public void ExpressionTests_FloatQualifiers_Negative() | |
Assert.Equal(resultValues.ToArray(), result2.ToArray()); | ||
} | ||
|
||
[Fact] | ||
public void ExpressionTests_DecimalQualifiers() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please order the test alphabetically in the file. |
||
{ | ||
//Arrange | ||
var values = new[] { 1m, 2M, 3M }.AsQueryable(); | ||
var resultValues = new[] { 2m, 3m }.AsQueryable(); | ||
|
||
//Act | ||
var result1 = values.Where("it == 2M or it == 3m"); | ||
var result2 = values.Where("it == 2.0M or it == 3.00m"); | ||
|
||
//Assert | ||
Assert.Equal(resultValues.ToArray(), result1.ToArray()); | ||
Assert.Equal(resultValues.ToArray(), result2.ToArray()); | ||
} | ||
|
||
[Fact] | ||
public void ExpressionTests_DecimalQualifiers_Negative() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please order the test alphabetically in the file. |
||
{ | ||
//Arrange | ||
var values = new[] { -1m, -2M, -3M }.AsQueryable(); | ||
var resultValues = new[] { -2m, -3m }.AsQueryable(); | ||
|
||
//Act | ||
var result1 = values.Where("it == -2M or it == -3m"); | ||
var result2 = values.Where("it == -2.0M or it == -3.0m"); | ||
|
||
//Assert | ||
Assert.Equal(resultValues.ToArray(), result1.ToArray()); | ||
Assert.Equal(resultValues.ToArray(), result2.ToArray()); | ||
} | ||
|
||
[Fact] | ||
public void ExpressionTests_Guid_CompareTo_String() | ||
{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -131,6 +131,30 @@ public void TextParser_Parse_RealLiteralPlus() | |
Check.That(textParser.CurrentToken.Text).Equals("1.0E+25"); | ||
} | ||
|
||
[Fact] | ||
public void TextParser_Parse_RealLiteralFloatQualifier() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please order the test alphabetically in the file. |
||
{ | ||
// Assign + Act | ||
var textParser = new TextParser(" 12.5f "); | ||
|
||
// Assert | ||
Check.That(textParser.CurrentToken.Id).Equals(TokenId.RealLiteral); | ||
Check.That(textParser.CurrentToken.Pos).Equals(1); | ||
Check.That(textParser.CurrentToken.Text).Equals("12.5f"); | ||
} | ||
|
||
[Fact] | ||
public void TextParser_Parse_RealLiteralDecimalQualifier() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please order the test alphabetically in the file. |
||
{ | ||
// Assign + Act | ||
var textParser = new TextParser(" 12.5m "); | ||
|
||
// Assert | ||
Check.That(textParser.CurrentToken.Id).Equals(TokenId.RealLiteral); | ||
Check.That(textParser.CurrentToken.Pos).Equals(1); | ||
Check.That(textParser.CurrentToken.Text).Equals("12.5m"); | ||
} | ||
|
||
[Fact] | ||
public void TextParser_Parse_Percent() | ||
{ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please order the test alphabetically in the file.