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

Public Member Functions

void String_Create ()
 
void String_Compare_Equal ()
 
void String_Equals ()
 
void String_Concat ()
 
void String_EqualsToNull ()
 
void String_Convert_TimeStamp ()
 
void String_Convert_Time ()
 
void String_Convert_Date ()
 
void String_Convert_BigNumber ()
 
void String_Convert_BooleanTrue ()
 
void String_Convert_BooleanFalse ()
 
void String_Convert_BooleanNull ()
 

Detailed Description

Definition at line 24 of file SqlStringTests.cs.

Member Function Documentation

void Deveel.Data.Sql.Objects.SqlStringTests.String_Compare_Equal ( )
inline

Definition at line 37 of file SqlStringTests.cs.

37  {
38  const string s = "Test string in UTF-16 LE";
39  var sqlString1 = new SqlString(s);
40  var sqlString2 = new SqlString(s);
41  Assert.AreEqual(0, sqlString1.CompareTo(sqlString2));
42  }
Deveel.Data.Sql.Objects.SqlString SqlString
Definition: DataObject.cs:27
void Deveel.Data.Sql.Objects.SqlStringTests.String_Concat ( )
inline

Definition at line 55 of file SqlStringTests.cs.

55  {
56  const string s1 = "First string comes before the ";
57  const string s2 = "Second string that comes after";
58  var sqlString1 = new SqlString(s1);
59  var sqlString2 = new SqlString(s2);
60 
61  var sqlString3 = new SqlString();
62  Assert.DoesNotThrow(() => sqlString3 = sqlString1.Concat(sqlString2));
63  Assert.AreEqual("First string comes before the Second string that comes after", sqlString3.ToString(Encoding.UTF8));
64  }
Deveel.Data.Sql.Objects.SqlString SqlString
Definition: DataObject.cs:27
void Deveel.Data.Sql.Objects.SqlStringTests.String_Convert_BigNumber ( )
inline

Definition at line 136 of file SqlStringTests.cs.

136  {
137  const string s = "7689994.0000033992988477226661525553666370058812345883288477383";
138  var sqlString = new SqlString(s);
139 
140  var number = new SqlNumber();
141  Assert.DoesNotThrow(() => number = (SqlNumber)Convert.ChangeType(sqlString, typeof(SqlNumber)));
142  Assert.IsFalse(number.IsNull);
143  Assert.IsFalse(number.CanBeInt32);
144  Assert.IsFalse(number.CanBeInt64);
145  Assert.AreEqual(NumericState.None, number.State);
146  }
NumericState
Lists all the possible special states of a number.
Definition: NumericState.cs:21
Deveel.Data.Sql.Objects.SqlString SqlString
Definition: DataObject.cs:27
void Deveel.Data.Sql.Objects.SqlStringTests.String_Convert_BooleanFalse ( )
inline

Definition at line 164 of file SqlStringTests.cs.

164  {
165  const string s = "false";
166  var sqlString = new SqlString(s);
167 
168  var b = new SqlBoolean();
169  Assert.DoesNotThrow(() => b = (SqlBoolean)Convert.ChangeType(sqlString, typeof(SqlBoolean)));
170  Assert.IsFalse(b.IsNull);
171  Assert.AreEqual(SqlBoolean.False, b);
172  }
Deveel.Data.Sql.Objects.SqlBoolean SqlBoolean
Definition: DataObject.cs:26
Deveel.Data.Sql.Objects.SqlString SqlString
Definition: DataObject.cs:27
void Deveel.Data.Sql.Objects.SqlStringTests.String_Convert_BooleanNull ( )
inline

Definition at line 177 of file SqlStringTests.cs.

177  {
178  const string s = "";
179  var sqlString = new SqlString(s);
180 
181  var b = new SqlBoolean();
182  Assert.DoesNotThrow(() => b = (SqlBoolean)Convert.ChangeType(sqlString, typeof(SqlBoolean)));
183  Assert.IsTrue(b.IsNull);
184  Assert.AreEqual(SqlBoolean.Null, b);
185  }
Deveel.Data.Sql.Objects.SqlBoolean SqlBoolean
Definition: DataObject.cs:26
Deveel.Data.Sql.Objects.SqlString SqlString
Definition: DataObject.cs:27
void Deveel.Data.Sql.Objects.SqlStringTests.String_Convert_BooleanTrue ( )
inline

Definition at line 151 of file SqlStringTests.cs.

151  {
152  const string s = "true";
153  var sqlString = new SqlString(s);
154 
155  var b = new SqlBoolean();
156  Assert.DoesNotThrow(() => b = (SqlBoolean)Convert.ChangeType(sqlString, typeof(SqlBoolean)));
157  Assert.IsFalse(b.IsNull);
158  Assert.AreEqual(SqlBoolean.True, b);
159  }
Deveel.Data.Sql.Objects.SqlBoolean SqlBoolean
Definition: DataObject.cs:26
Deveel.Data.Sql.Objects.SqlString SqlString
Definition: DataObject.cs:27
void Deveel.Data.Sql.Objects.SqlStringTests.String_Convert_Date ( )
inline

Definition at line 116 of file SqlStringTests.cs.

116  {
117  const string s = "2011-01-23";
118  var sqlString = new SqlString(s);
119 
120  var date = new SqlDateTime();
121  Assert.DoesNotThrow(() => date = (SqlDateTime) Convert.ChangeType(sqlString, typeof(SqlDateTime)));
122  Assert.IsFalse(date.IsNull);
123  Assert.AreEqual(2011, date.Year);
124  Assert.AreEqual(01, date.Month);
125  Assert.AreEqual(23, date.Day);
126  Assert.AreEqual(0, date.Hour);
127  Assert.AreEqual(0, date.Minute);
128  Assert.AreEqual(0, date.Millisecond);
129  Assert.AreEqual(0, date.Offset.Hours);
130  Assert.AreEqual(0, date.Offset.Minutes);
131  }
Deveel.Data.Sql.Objects.SqlString SqlString
Definition: DataObject.cs:27
void Deveel.Data.Sql.Objects.SqlStringTests.String_Convert_Time ( )
inline

Definition at line 97 of file SqlStringTests.cs.

97  {
98  const string s = "23:44:21.525";
99  var sqlString = new SqlString(s);
100 
101  var time = new SqlDateTime();
102  Assert.DoesNotThrow(() => time = (SqlDateTime) Convert.ChangeType(sqlString, typeof(SqlDateTime)));
103  Assert.IsFalse(time.IsNull);
104  Assert.AreEqual(1, time.Year);
105  Assert.AreEqual(1, time.Month);
106  Assert.AreEqual(1, time.Day);
107  Assert.AreEqual(23, time.Hour);
108  Assert.AreEqual(44, time.Minute);
109  Assert.AreEqual(21, time.Second);
110  Assert.AreEqual(525, time.Millisecond);
111  }
Deveel.Data.Sql.Objects.SqlString SqlString
Definition: DataObject.cs:27
void Deveel.Data.Sql.Objects.SqlStringTests.String_Convert_TimeStamp ( )
inline

Definition at line 77 of file SqlStringTests.cs.

77  {
78  const string s = "2011-01-23T23:44:21.525 +01:00";
79  var sqlString = new SqlString(s);
80 
81  var timeStamp = new SqlDateTime();
82  Assert.DoesNotThrow(() => timeStamp = (SqlDateTime) Convert.ChangeType(sqlString, typeof(SqlDateTime)));
83  Assert.IsFalse(timeStamp.IsNull);
84  Assert.AreEqual(2011, timeStamp.Year);
85  Assert.AreEqual(01, timeStamp.Month);
86  Assert.AreEqual(23, timeStamp.Day);
87  Assert.AreEqual(23, timeStamp.Hour);
88  Assert.AreEqual(44, timeStamp.Minute);
89  Assert.AreEqual(525, timeStamp.Millisecond);
90  Assert.AreEqual(1, timeStamp.Offset.Hours);
91  Assert.AreEqual(0, timeStamp.Offset.Minutes);
92  }
Deveel.Data.Sql.Objects.SqlString SqlString
Definition: DataObject.cs:27
void Deveel.Data.Sql.Objects.SqlStringTests.String_Create ( )
inline

Definition at line 27 of file SqlStringTests.cs.

27  {
28  const string s = "Test string UTF-16 LE";
29  var sqlString = new SqlString(s);
30  Assert.IsNotNull(sqlString);
31  Assert.AreEqual(s.Length, sqlString.Length);
32  Assert.AreEqual(s, sqlString);
33  }
Deveel.Data.Sql.Objects.SqlString SqlString
Definition: DataObject.cs:27
void Deveel.Data.Sql.Objects.SqlStringTests.String_Equals ( )
inline

Definition at line 46 of file SqlStringTests.cs.

46  {
47  const string s = "Test string in UTF-16 LE";
48  var sqlString1 = new SqlString(s);
49  var sqlString2 = new SqlString(s);
50  Assert.IsTrue(sqlString1.Equals(sqlString2));
51  }
Deveel.Data.Sql.Objects.SqlString SqlString
Definition: DataObject.cs:27
void Deveel.Data.Sql.Objects.SqlStringTests.String_EqualsToNull ( )
inline

Definition at line 67 of file SqlStringTests.cs.

67  {
68  var s = SqlString.Null;
69  Assert.IsTrue(s.IsNull);
70  Assert.AreEqual(SqlNull.Value, s);
71  Assert.AreEqual(s, SqlNull.Value);
72  }

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