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

Public Member Functions

void BetweenNumerics ()
 
void BetweenDates ()
 

Detailed Description

Definition at line 24 of file SqlBetweenEspressionTests.cs.

Member Function Documentation

void Deveel.Data.Sql.Expressions.SqlBetweenEspressionTests.BetweenDates ( )
inline

Definition at line 48 of file SqlBetweenEspressionTests.cs.

48  {
49  const string sql = "TODATE('2001-02-12') BETWEEN TODATE('2000-01-20') AND TODATE('2003-01-01')";
50 
51  SqlExpression expression = null;
52  Assert.DoesNotThrow(() => expression = SqlExpression.Parse(sql));
53  Assert.IsNotNull(expression);
54 
55  Assert.IsInstanceOf<SqlBinaryExpression>(expression);
56  Assert.AreEqual(SqlExpressionType.And, expression.ExpressionType);
57 
58  SqlExpression resultExpression = null;
59  Assert.DoesNotThrow(() => resultExpression = expression.Evaluate());
60  Assert.IsNotNull(resultExpression);
61  Assert.AreEqual(SqlExpressionType.Constant, resultExpression.ExpressionType);
62 
63  var value = ((SqlConstantExpression)resultExpression).Value;
64 
65  Assert.IsInstanceOf<BooleanType>(value.Type);
66  Assert.AreEqual(SqlBoolean.True, (SqlBoolean)value.Value);
67  }
SqlExpressionType
All the possible type of SqlExpression supported
void Deveel.Data.Sql.Expressions.SqlBetweenEspressionTests.BetweenNumerics ( )
inline

Definition at line 26 of file SqlBetweenEspressionTests.cs.

26  {
27  const string sql = "22 BETWEEN 10 AND 54";
28 
29  SqlExpression expression = null;
30  Assert.DoesNotThrow(() => expression = SqlExpression.Parse(sql));
31  Assert.IsNotNull(expression);
32 
33  Assert.IsInstanceOf<SqlBinaryExpression>(expression);
34  Assert.AreEqual(SqlExpressionType.And, expression.ExpressionType);
35 
36  SqlExpression resultExpression = null;
37  Assert.DoesNotThrow(() => resultExpression = expression.Evaluate());
38  Assert.IsNotNull(resultExpression);
39  Assert.AreEqual(SqlExpressionType.Constant, resultExpression.ExpressionType);
40 
41  var value = ((SqlConstantExpression) resultExpression).Value;
42 
43  Assert.IsInstanceOf<BooleanType>(value.Type);
44  Assert.AreEqual(SqlBoolean.True, (SqlBoolean)value.Value);
45  }
SqlExpressionType
All the possible type of SqlExpression supported

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