Skip to content

Commit a77119a

Browse files
committed
1 parent 0bde781 commit a77119a

File tree

2 files changed

+55
-46
lines changed

2 files changed

+55
-46
lines changed

src/System.Linq.Dynamic.Core/Res.cs

+45-45
Original file line numberDiff line numberDiff line change
@@ -2,63 +2,63 @@
22
{
33
internal static class Res
44
{
5-
public const string IQueryableProviderNotAsync = "The provider for the source IQueryable doesn't implement IAsyncQueryProvider/IDbAsyncQueryProvider. Only providers that implement IAsyncQueryProvider/IDbAsyncQueryProvider can be used for Entity Framework asynchronous operations.";
5+
public const string AmbiguousConstructorInvocation = "Ambiguous invocation of '{0}' constructor";
6+
public const string AmbiguousIndexerInvocation = "Ambiguous invocation of indexer in type '{0}'";
7+
public const string AmbiguousMethodInvocation = "Ambiguous invocation of method '{0}' in type '{1}'";
8+
public const string ArgsIncompatibleWithLambda = "Argument list incompatible with lambda expression";
9+
public const string BothTypesConvertToOther = "Both of the types '{0}' and '{1}' convert to the other";
10+
public const string CannotConvertValue = "A value of type '{0}' cannot be converted to type '{1}'";
11+
public const string CannotIndexMultiDimArray = "Indexing of multi-dimensional arrays is not supported";
12+
public const string CloseBracketExpected = "']' expected";
13+
public const string CloseBracketOrCommaExpected = "']' or ',' expected";
14+
public const string CloseParenOrCommaExpected = "')' or ',' expected";
15+
public const string CloseParenOrOperatorExpected = "')' or operator expected";
16+
public const string ColonExpected = "':' expected";
17+
public const string DigitExpected = "Digit expected";
18+
public const string DotOrOpenParenExpected = "'.' or '(' expected";
19+
public const string DotOrOpenParenOrStringLiteralExpected = "'.' or '(' or string literal expected";
620
public const string DuplicateIdentifier = "The identifier '{0}' was defined more than once";
7-
public const string ExpressionTypeMismatch = "Expression of type '{0}' expected";
821
public const string ExpressionExpected = "Expression expected";
22+
public const string ExpressionTypeMismatch = "Expression of type '{0}' expected";
23+
public const string FirstExprMustBeBool = "The first expression must be of type 'Boolean'";
24+
public const string HexCharExpected = "Hexadecimal character expected";
25+
public const string IQueryableProviderNotAsync = "The provider for the source IQueryable doesn't implement IAsyncQueryProvider/IDbAsyncQueryProvider. Only providers that implement IAsyncQueryProvider/IDbAsyncQueryProvider can be used for Entity Framework asynchronous operations.";
26+
public const string IdentifierExpected = "Identifier expected";
27+
public const string IdentifierImplementingInterfaceExpected = "Identifier implementing interface '{0}' expected";
28+
public const string IifRequiresThreeArgs = "The 'iif' function requires three arguments";
29+
public const string IncompatibleOperand = "Operator '{0}' incompatible with operand type '{1}'";
30+
public const string IncompatibleOperands = "Operator '{0}' incompatible with operand types '{1}' and '{2}'";
31+
public const string IncompatibleTypes = "Types '{0}' and '{1}' are incompatible";
32+
public const string InvalidCharacter = "Syntax error '{0}'";
933
public const string InvalidCharacterLiteral = "Character literal must contain exactly one character";
34+
public const string InvalidIndex = "Array index must be an integer expression";
1035
public const string InvalidIntegerLiteral = "Invalid integer literal '{0}'";
1136
public const string InvalidIntegerQualifier = "Invalid integer literal qualifier '{0}'";
12-
public const string MinusCannotBeAppliedToUnsignedInteger = "'-' cannot be applied to unsigned integers.";
1337
public const string InvalidRealLiteral = "Invalid real literal '{0}'";
14-
public const string UnknownIdentifier = "Unknown identifier '{0}'";
15-
public const string NoItInScope = "No 'it' is in scope";
16-
public const string NoParentInScope = "No 'parent' is in scope";
17-
public const string NoRootInScope = "No 'root' is in scope";
18-
public const string IifRequiresThreeArgs = "The 'iif' function requires three arguments";
1938
public const string IsNullRequiresTwoArgs = "The 'isnull' function requires two arguments";
20-
public const string FirstExprMustBeBool = "The first expression must be of type 'Boolean'";
21-
public const string BothTypesConvertToOther = "Both of the types '{0}' and '{1}' convert to the other";
22-
public const string NeitherTypeConvertsToOther = "Neither of the types '{0}' and '{1}' converts to the other";
23-
public const string MissingAsClause = "Expression is missing an 'as' clause";
24-
public const string ArgsIncompatibleWithLambda = "Argument list incompatible with lambda expression";
25-
public const string TypeHasNoNullableForm = "Type '{0}' has no nullable form";
26-
public const string NoMatchingConstructor = "No matching constructor in type '{0}'";
27-
public const string AmbiguousConstructorInvocation = "Ambiguous invocation of '{0}' constructor";
28-
public const string CannotConvertValue = "A value of type '{0}' cannot be converted to type '{1}'";
29-
public const string NoApplicableMethod = "No applicable method '{0}' exists in type '{1}'";
30-
public const string MethodsAreInaccessible = "Methods on type '{0}' are not accessible";
3139
public const string MethodIsVoid = "Method '{0}' in type '{1}' does not return a value";
32-
public const string AmbiguousMethodInvocation = "Ambiguous invocation of method '{0}' in type '{1}'";
33-
public const string UnknownPropertyOrField = "No property or field '{0}' exists in type '{1}'";
40+
public const string MethodsAreInaccessible = "Methods on type '{0}' are not accessible";
41+
public const string MinusCannotBeAppliedToUnsignedInteger = "'-' cannot be applied to unsigned integers.";
42+
public const string MissingAsClause = "Expression is missing an 'as' clause";
43+
public const string NeitherTypeConvertsToOther = "Neither of the types '{0}' and '{1}' converts to the other";
3444
public const string NoApplicableAggregate = "No applicable aggregate method '{0}' exists";
35-
public const string CannotIndexMultiDimArray = "Indexing of multi-dimensional arrays is not supported";
36-
public const string InvalidIndex = "Array index must be an integer expression";
3745
public const string NoApplicableIndexer = "No applicable indexer exists in type '{0}'";
38-
public const string AmbiguousIndexerInvocation = "Ambiguous invocation of indexer in type '{0}'";
39-
public const string IncompatibleOperand = "Operator '{0}' incompatible with operand type '{1}'";
40-
public const string IncompatibleOperands = "Operator '{0}' incompatible with operand types '{1}' and '{2}'";
41-
public const string IncompatibleTypes = "Types '{0}' and '{1}' are incompatible";
42-
public const string UnterminatedStringLiteral = "Unterminated string literal";
43-
public const string InvalidCharacter = "Syntax error '{0}'";
44-
public const string DigitExpected = "Digit expected";
45-
public const string HexCharExpected = "Hexadecimal character expected";
46-
public const string SyntaxError = "Syntax error";
47-
public const string TokenExpected = "{0} expected";
48-
public const string ParseExceptionFormat = "{0} (at index {1})";
49-
public const string ColonExpected = "':' expected";
50-
public const string OpenParenExpected = "'(' expected";
51-
public const string OpenCurlyParenExpected = "'{' expected";
52-
public const string CloseParenOrOperatorExpected = "')' or operator expected";
53-
public const string CloseParenOrCommaExpected = "')' or ',' expected";
54-
public const string DotOrOpenParenExpected = "'.' or '(' expected";
55-
public const string DotOrOpenParenOrStringLiteralExpected = "'.' or '(' or string literal expected";
46+
public const string NoApplicableMethod = "No applicable method '{0}' exists in type '{1}'";
47+
public const string NoItInScope = "No 'it' is in scope";
48+
public const string NoMatchingConstructor = "No matching constructor in type '{0}'";
49+
public const string NoParentInScope = "No 'parent' is in scope";
50+
public const string NoRootInScope = "No 'root' is in scope";
5651
public const string OpenBracketExpected = "'[' expected";
57-
public const string CloseBracketOrCommaExpected = "']' or ',' expected";
58-
public const string CloseBracketExpected = "']' expected";
59-
public const string IdentifierExpected = "Identifier expected";
52+
public const string OpenCurlyParenExpected = "'{' expected";
53+
public const string OpenParenExpected = "'(' expected";
6054
public const string OpenParenOrIdentifierExpected = "'(' or Identifier expected";
61-
public const string IdentifierImplementingInterfaceExpected = "Identifier implementing interface '{0}' expected";
55+
public const string ParseExceptionFormat = "{0} (at index {1})";
56+
public const string SyntaxError = "Syntax error";
57+
public const string TokenExpected = "{0} expected";
58+
public const string TypeHasNoNullableForm = "Type '{0}' has no nullable form";
6259
public const string TypeNotFound = "Type '{0}' not Found";
60+
public const string UnknownIdentifier = "Unknown identifier '{0}'";
61+
public const string UnknownPropertyOrField = "No property or field '{0}' exists in type '{1}'";
62+
public const string UnterminatedStringLiteral = "Unterminated string literal";
6363
}
6464
}

test/System.Linq.Dynamic.Core.Tests/ExpressionTests.cs

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System.Collections.Generic;
22
using System.Dynamic;
33
using System.Globalization;
4-
using System.Linq.Dynamic.Core.Extensions;
54
using System.Linq.Dynamic.Core.Exceptions;
65
using System.Linq.Dynamic.Core.Tests.Helpers;
76
using System.Linq.Dynamic.Core.Tests.Helpers.Models;
@@ -1014,6 +1013,16 @@ public void ExpressionTests_Shift()
10141013
ExpressionTests_ShiftInternal<ulong, ulong>();
10151014
}
10161015

1016+
[Fact]
1017+
public void ExpressionTests_Shift_Exception()
1018+
{
1019+
// Assign
1020+
var qry = new[] { 10, 20, 30 }.AsQueryable();
1021+
1022+
// Act and Assert
1023+
Check.ThatCode(() => qry.Select("it <<< 1")).Throws<ParseException>();
1024+
}
1025+
10171026
private static void ExpressionTests_ShiftInternal<TItemType, TResult>()
10181027
{
10191028
//Arrange

0 commit comments

Comments
 (0)