Definition at line 24 of file SqlCastExpressionTests.cs.
void Deveel.Data.Sql.Expressions.SqlCastExpressionTests.CastBooleanFalseToString |
( |
| ) |
|
|
inline |
Definition at line 145 of file SqlCastExpressionTests.cs.
146 var exp = SqlExpression.Cast(SqlExpression.Constant(DataObject.Boolean(
false)),
PrimitiveTypes.
String());
148 SqlExpression casted = null;
149 Assert.DoesNotThrow(() => casted = exp.Evaluate());
150 Assert.IsNotNull(casted);
151 Assert.IsInstanceOf<SqlConstantExpression>(casted);
153 var value = ((SqlConstantExpression)casted).Value;
154 Assert.IsNotNull(value.Value);
156 Assert.AreEqual(
SqlTypeCode.String, value.Type.TypeCode);
Provides some helper functions for resolving and creating SqlType instances that are primitive to the...
SqlTypeCode
Enumerates the codes of all SQL types handled by the system.
static StringType String()
Deveel.Data.Sql.Objects.SqlString SqlString
void Deveel.Data.Sql.Expressions.SqlCastExpressionTests.CastBooleanTrueToString |
( |
| ) |
|
|
inline |
Definition at line 161 of file SqlCastExpressionTests.cs.
162 var exp = SqlExpression.Cast(SqlExpression.Constant(DataObject.Boolean(
true)),
PrimitiveTypes.
String());
164 SqlExpression casted = null;
165 Assert.DoesNotThrow(() => casted = exp.Evaluate());
166 Assert.IsNotNull(casted);
167 Assert.IsInstanceOf<SqlConstantExpression>(casted);
169 var value = ((SqlConstantExpression)casted).Value;
170 Assert.IsNotNull(value.Value);
172 Assert.AreEqual(
SqlTypeCode.String, value.Type.TypeCode);
Provides some helper functions for resolving and creating SqlType instances that are primitive to the...
SqlTypeCode
Enumerates the codes of all SQL types handled by the system.
static StringType String()
Deveel.Data.Sql.Objects.SqlString SqlString
void Deveel.Data.Sql.Expressions.SqlCastExpressionTests.CastDateToString |
( |
| ) |
|
|
inline |
Definition at line 177 of file SqlCastExpressionTests.cs.
178 var date = DataObject.Date(
new SqlDateTime(2015, 02, 03));
181 SqlExpression casted = null;
182 Assert.DoesNotThrow(() => casted = exp.Evaluate());
183 Assert.IsNotNull(casted);
184 Assert.IsInstanceOf<SqlConstantExpression>(casted);
186 var value = ((SqlConstantExpression)casted).Value;
187 Assert.IsNotNull(value.Value);
189 Assert.AreEqual(
SqlTypeCode.String, value.Type.TypeCode);
Provides some helper functions for resolving and creating SqlType instances that are primitive to the...
SqlTypeCode
Enumerates the codes of all SQL types handled by the system.
static StringType String()
Deveel.Data.Sql.Objects.SqlString SqlString
void Deveel.Data.Sql.Expressions.SqlCastExpressionTests.CastNumberToString |
( |
| ) |
|
|
inline |
void Deveel.Data.Sql.Expressions.SqlCastExpressionTests.CastStringToBooleanFalse |
( |
| ) |
|
|
inline |
Definition at line 129 of file SqlCastExpressionTests.cs.
130 var exp = SqlExpression.Cast(SqlExpression.Constant(DataObject.String(
"false")),
PrimitiveTypes.
Boolean());
132 SqlExpression casted = null;
133 Assert.DoesNotThrow(() => casted = exp.Evaluate());
134 Assert.IsNotNull(casted);
135 Assert.IsInstanceOf<SqlConstantExpression>(casted);
137 var value = ((SqlConstantExpression)casted).Value;
138 Assert.IsNotNull(value.Value);
140 Assert.AreEqual(
SqlTypeCode.Boolean, value.Type.TypeCode);
141 Assert.AreEqual(
SqlBoolean.False, value.Value);
Provides some helper functions for resolving and creating SqlType instances that are primitive to the...
static BooleanType Boolean()
SqlTypeCode
Enumerates the codes of all SQL types handled by the system.
void Deveel.Data.Sql.Expressions.SqlCastExpressionTests.CastStringToBooleanTrue |
( |
| ) |
|
|
inline |
Definition at line 113 of file SqlCastExpressionTests.cs.
114 var exp = SqlExpression.Cast(SqlExpression.Constant(DataObject.String(
"true")),
PrimitiveTypes.
Boolean());
116 SqlExpression casted = null;
117 Assert.DoesNotThrow(() => casted = exp.Evaluate());
118 Assert.IsNotNull(casted);
119 Assert.IsInstanceOf<SqlConstantExpression>(casted);
121 var value = ((SqlConstantExpression)casted).Value;
122 Assert.IsNotNull(value.Value);
124 Assert.AreEqual(
SqlTypeCode.Boolean, value.Type.TypeCode);
125 Assert.AreEqual(
SqlBoolean.True, value.Value);
Provides some helper functions for resolving and creating SqlType instances that are primitive to the...
static BooleanType Boolean()
SqlTypeCode
Enumerates the codes of all SQL types handled by the system.
void Deveel.Data.Sql.Expressions.SqlCastExpressionTests.CastStringToDate |
( |
| ) |
|
|
inline |
Definition at line 74 of file SqlCastExpressionTests.cs.
75 var exp = SqlExpression.Cast(SqlExpression.Constant(DataObject.String(
"2015-09-01")),
PrimitiveTypes.
Date());
77 SqlExpression casted = null;
78 Assert.DoesNotThrow(() => casted = exp.Evaluate());
79 Assert.IsNotNull(casted);
80 Assert.IsInstanceOf<SqlConstantExpression>(casted);
82 var value = ((SqlConstantExpression)casted).Value;
83 Assert.IsNotNull(value.Value);
84 Assert.IsInstanceOf<
DateType>(value.Type);
85 Assert.AreEqual(
SqlTypeCode.Date, value.Type.TypeCode);
86 Assert.AreEqual(
new SqlDateTime(2015, 09, 01), value.Value);
Provides some helper functions for resolving and creating SqlType instances that are primitive to the...
SqlTypeCode
Enumerates the codes of all SQL types handled by the system.
void Deveel.Data.Sql.Expressions.SqlCastExpressionTests.CastStringToDateTime |
( |
| ) |
|
|
inline |
Definition at line 58 of file SqlCastExpressionTests.cs.
59 var exp = SqlExpression.Cast(SqlExpression.Constant(DataObject.String(
"2015-09-01")),
PrimitiveTypes.
DateTime());
61 SqlExpression casted = null;
62 Assert.DoesNotThrow(() => casted = exp.Evaluate());
63 Assert.IsNotNull(casted);
64 Assert.IsInstanceOf<SqlConstantExpression>(casted);
66 var value = ((SqlConstantExpression)casted).Value;
67 Assert.IsNotNull(value.Value);
68 Assert.IsInstanceOf<
DateType>(value.Type);
69 Assert.AreEqual(
SqlTypeCode.DateTime, value.Type.TypeCode);
70 Assert.AreEqual(
new SqlDateTime(2015, 09, 01), value.Value);
Provides some helper functions for resolving and creating SqlType instances that are primitive to the...
static DateType DateTime()
SqlTypeCode
Enumerates the codes of all SQL types handled by the system.
void Deveel.Data.Sql.Expressions.SqlCastExpressionTests.CastStringToInteger |
( |
| ) |
|
|
inline |
Definition at line 26 of file SqlCastExpressionTests.cs.
27 var exp = SqlExpression.Cast(SqlExpression.Constant(DataObject.String(
"1234")),
PrimitiveTypes.
Integer());
29 SqlExpression casted = null;
30 Assert.DoesNotThrow(() => casted = exp.Evaluate());
31 Assert.IsNotNull(casted);
32 Assert.IsInstanceOf<SqlConstantExpression>(casted);
34 var value = ((SqlConstantExpression) casted).Value;
35 Assert.IsNotNull(value.Value);
37 Assert.AreEqual(
SqlTypeCode.Integer, value.Type.TypeCode);
38 Assert.AreEqual(
new SqlNumber(1234), value.Value);
Provides some helper functions for resolving and creating SqlType instances that are primitive to the...
static NumericType Integer()
SqlTypeCode
Enumerates the codes of all SQL types handled by the system.
void Deveel.Data.Sql.Expressions.SqlCastExpressionTests.CastStringToNumber |
( |
| ) |
|
|
inline |
Definition at line 42 of file SqlCastExpressionTests.cs.
43 var exp = SqlExpression.Cast(SqlExpression.Constant(DataObject.String(
"12.3e4")),
PrimitiveTypes.
Numeric());
45 SqlExpression casted = null;
46 Assert.DoesNotThrow(() => casted = exp.Evaluate());
47 Assert.IsNotNull(casted);
48 Assert.IsInstanceOf<SqlConstantExpression>(casted);
50 var value = ((SqlConstantExpression)casted).Value;
51 Assert.IsNotNull(value.Value);
53 Assert.AreEqual(
SqlTypeCode.Numeric, value.Type.TypeCode);
Provides some helper functions for resolving and creating SqlType instances that are primitive to the...
static NumericType Numeric()
SqlTypeCode
Enumerates the codes of all SQL types handled by the system.
static SqlNumber Parse(string s)
void Deveel.Data.Sql.Expressions.SqlCastExpressionTests.CastStringToTime |
( |
| ) |
|
|
inline |
Definition at line 90 of file SqlCastExpressionTests.cs.
91 var exp = SqlExpression.Cast(SqlExpression.Constant(DataObject.String(
"22:13:01")),
PrimitiveTypes.
Time());
93 SqlExpression casted = null;
94 Assert.DoesNotThrow(() => casted = exp.Evaluate());
95 Assert.IsNotNull(casted);
96 Assert.IsInstanceOf<SqlConstantExpression>(casted);
98 var value = ((SqlConstantExpression)casted).Value;
99 Assert.IsNotNull(value.Value);
100 Assert.IsInstanceOf<
DateType>(value.Type);
101 Assert.AreEqual(
SqlTypeCode.Time, value.Type.TypeCode);
107 var expected =
new SqlDateTime(1, 1, 1, 22, 13, 01, 0, result.Offset);
108 Assert.AreEqual(expected, result);
Provides some helper functions for resolving and creating SqlType instances that are primitive to the...
SqlTypeCode
Enumerates the codes of all SQL types handled by the system.
The documentation for this class was generated from the following file:
- /var/calculate/remote/distfiles/egit-src/deveeldb.git/src/deveeldb-nunit/Deveel.Data.Sql.Expressions/SqlCastExpressionTests.cs