internal static void UnexpectedOrInvalidExpressionToken([NotNull] ExpressionException innerException, [NotNull] Token token) { Debug.Assert(token != null, "token cannot be null."); Debug.Assert(innerException != null, "innerException cannot be null."); throw new LexingException( innerException, token, "Unexpected or invalid expression token '{0}' (type: {1}) found at position {2}. Error: {3}", token.Value, token.Type, token.CharacterIndex, innerException.Message); }
public void Exceptions() { var exprEx = new ExpressionException("test"); Assert.Equal("test", exprEx.SimpleMessage); Assert.Equal("test", exprEx.ToDetailedString()); Assert.Equal("test", exprEx.Message); exprEx = new ExpressionException("wibble", "test"); Assert.Equal("test", exprEx.SimpleMessage); Assert.Equal("Expression [wibble]: test", exprEx.ToDetailedString()); Assert.Equal("Expression [wibble]: test", exprEx.Message); exprEx = new ExpressionException("wibble", 3, "test"); Assert.Equal("test", exprEx.SimpleMessage); Assert.Equal("Expression [wibble] @3: test", exprEx.ToDetailedString()); Assert.Equal("Expression [wibble] @3: test", exprEx.Message); }