DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Public Member Functions | List of all members
Deveel.Data.Sql.Expressions.SqlExpressionParseException Class Reference

Public Member Functions

void SimpleNumericAdd ()
 
void SimpleNumericSubtract ()
 
void ChainedAddAndMultipleNumeric ()
 

Detailed Description

Definition at line 24 of file SqlExpressionParseTests.cs.

Member Function Documentation

void Deveel.Data.Sql.Expressions.SqlExpressionParseException.ChainedAddAndMultipleNumeric ( )
inline

Definition at line 58 of file SqlExpressionParseTests.cs.

58  {
59  const string s = "75664 + 907 * 87";
60 
61  SqlExpression sqlExp = null;
62  Assert.DoesNotThrow(() => sqlExp = SqlExpression.Parse(s));
63  Assert.IsNotNull(sqlExp);
64  Assert.IsInstanceOf<SqlBinaryExpression>(sqlExp);
65  Assert.AreEqual(SqlExpressionType.Add, sqlExp.ExpressionType);
66 
67  var binExp = (SqlBinaryExpression) sqlExp;
68  Assert.IsInstanceOf<SqlConstantExpression>(binExp.Left);
69  Assert.IsInstanceOf<SqlBinaryExpression>(binExp.Right);
70  Assert.IsTrue(binExp.CanEvaluate);
71 
72  SqlExpression evalExp = null;
73  Assert.DoesNotThrow(() => evalExp = binExp.Evaluate());
74  Assert.IsNotNull(evalExp);
75  Assert.IsInstanceOf<SqlConstantExpression>(evalExp);
76 
77  var value = ((SqlConstantExpression) evalExp).Value;
78  Assert.IsInstanceOf<SqlNumber>(value.Value);
79  Assert.AreEqual(154573, ((SqlNumber)value.Value).ToInt32());
80  }
SqlExpressionType
All the possible type of SqlExpression supported
void Deveel.Data.Sql.Expressions.SqlExpressionParseException.SimpleNumericAdd ( )
inline

Definition at line 26 of file SqlExpressionParseTests.cs.

26  {
27  const string s = "6578 + 76.32";
28 
29  SqlExpression sqlExp = null;
30  Assert.DoesNotThrow(() => sqlExp = SqlExpression.Parse(s));
31  Assert.IsNotNull(sqlExp);
32  Assert.IsInstanceOf<SqlBinaryExpression>(sqlExp);
33  Assert.AreEqual(SqlExpressionType.Add, sqlExp.ExpressionType);
34 
35  var binExp = (SqlBinaryExpression) sqlExp;
36  Assert.IsInstanceOf<SqlConstantExpression>(binExp.Left);
37  Assert.IsInstanceOf<SqlConstantExpression>(binExp.Right);
38  Assert.IsTrue(binExp.CanEvaluate);
39  }
SqlExpressionType
All the possible type of SqlExpression supported
void Deveel.Data.Sql.Expressions.SqlExpressionParseException.SimpleNumericSubtract ( )
inline

Definition at line 42 of file SqlExpressionParseTests.cs.

42  {
43  const string s = "642.221 - 116.32";
44 
45  SqlExpression sqlExp = null;
46  Assert.DoesNotThrow(() => sqlExp = SqlExpression.Parse(s));
47  Assert.IsNotNull(sqlExp);
48  Assert.IsInstanceOf<SqlBinaryExpression>(sqlExp);
49  Assert.AreEqual(SqlExpressionType.Subtract, sqlExp.ExpressionType);
50 
51  var binExp = (SqlBinaryExpression) sqlExp;
52  Assert.IsInstanceOf<SqlConstantExpression>(binExp.Left);
53  Assert.IsInstanceOf<SqlConstantExpression>(binExp.Right);
54  Assert.IsTrue(binExp.CanEvaluate);
55  }
SqlExpressionType
All the possible type of SqlExpression supported

The documentation for this class was generated from the following file: