Definition at line 24 of file SqlUnaryExpressionTests.cs.
void Deveel.Data.Sql.Expressions.SqlUnaryExpressionTests.BooleanNegate |
( |
bool |
a, |
|
|
bool |
expected |
|
) |
| |
|
inline |
Definition at line 69 of file SqlUnaryExpressionTests.cs.
70 var exp1 = SqlExpression.Constant(DataObject.Boolean(a));
71 var negExp = SqlExpression.Negate(exp1);
73 SqlExpression resultExp = null;
74 Assert.DoesNotThrow(() => resultExp = negExp.Evaluate());
75 Assert.IsNotNull(resultExp);
76 Assert.IsInstanceOf<SqlConstantExpression>(resultExp);
78 var constExp = (SqlConstantExpression)resultExp;
79 Assert.IsNotNull(constExp.Value.Value);
80 Assert.IsInstanceOf<
BooleanType>(constExp.Value.Type);
81 Assert.IsInstanceOf<
SqlBoolean>(constExp.Value.Value);
83 var actual = ((
SqlBoolean)constExp.Value.Value);
85 Assert.AreEqual(expectedResult, actual);
Deveel.Data.Sql.Objects.SqlBoolean SqlBoolean
void Deveel.Data.Sql.Expressions.SqlUnaryExpressionTests.NumericNegate |
( |
double |
a, |
|
|
double |
expected |
|
) |
| |
|
inline |
Definition at line 48 of file SqlUnaryExpressionTests.cs.
49 var exp1 = SqlExpression.Constant(DataObject.Number(
new SqlNumber(a)));
50 var negExp = SqlExpression.Negate(exp1);
52 SqlExpression resultExp = null;
53 Assert.DoesNotThrow(() => resultExp = negExp.Evaluate());
54 Assert.IsNotNull(resultExp);
55 Assert.IsInstanceOf<SqlConstantExpression>(resultExp);
57 var constExp = (SqlConstantExpression)resultExp;
58 Assert.IsNotNull(constExp.Value.Value);
59 Assert.IsInstanceOf<
NumericType>(constExp.Value.Type);
60 Assert.IsInstanceOf<
SqlNumber>(constExp.Value.Value);
62 var actual = ((
SqlNumber)constExp.Value.Value);
63 var expectedResult =
new SqlNumber(expected);
64 Assert.AreEqual(expectedResult, actual);
void Deveel.Data.Sql.Expressions.SqlUnaryExpressionTests.NumericPlus |
( |
double |
a, |
|
|
double |
expected |
|
) |
| |
|
inline |
Definition at line 27 of file SqlUnaryExpressionTests.cs.
28 var exp1 = SqlExpression.Constant(DataObject.Number(
new SqlNumber(a)));
29 var plusExp = SqlExpression.UnaryPlus(exp1);
31 SqlExpression resultExp = null;
32 Assert.DoesNotThrow(() => resultExp = plusExp.Evaluate());
33 Assert.IsNotNull(resultExp);
34 Assert.IsInstanceOf<SqlConstantExpression>(resultExp);
36 var constExp = (SqlConstantExpression)resultExp;
37 Assert.IsNotNull(constExp.Value.Value);
38 Assert.IsInstanceOf<
NumericType>(constExp.Value.Type);
39 Assert.IsInstanceOf<
SqlNumber>(constExp.Value.Value);
41 var actual = ((
SqlNumber)constExp.Value.Value);
42 var expectedResult =
new SqlNumber(expected);
43 Assert.AreEqual(expectedResult, actual);
The documentation for this class was generated from the following file: