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

Public Member Functions

void CreateFromByte ()
 
void CreateFromBoolean ()
 
void Compare_Equal ()
 
void Compare_NotEqual ()
 
void Compare_ToBooleanNull ()
 
void Compare_ToNull ()
 
void Compare_ToNumber_InRange ()
 
void Compare_ToNumber_OutOfRange ()
 
void Equality_True ()
 
void Equality_False ()
 
void Equality_ToNull_True ()
 
void Convert_ToString ()
 

Detailed Description

Definition at line 24 of file SqlBooleanTest.cs.

Member Function Documentation

void Deveel.Data.Sql.Objects.SqlBooleanTest.Compare_Equal ( )
inline

Definition at line 53 of file SqlBooleanTest.cs.

53  {
54  var value1 = SqlBoolean.True;
55  var value2 = new SqlBoolean(true);
56 
57  Assert.IsFalse(value1.IsNull);
58  Assert.IsFalse(value2.IsNull);
59 
60  Assert.IsTrue(value1.IsComparableTo(value2));
61 
62  int i = -2;
63  Assert.DoesNotThrow(() => i = value1.CompareTo(value2));
64  Assert.AreEqual(0, i);
65  }
Deveel.Data.Sql.Objects.SqlBoolean SqlBoolean
Definition: DataObject.cs:26
void Deveel.Data.Sql.Objects.SqlBooleanTest.Compare_NotEqual ( )
inline

Definition at line 69 of file SqlBooleanTest.cs.

69  {
70  var value1 = SqlBoolean.False;
71  var value2 = new SqlBoolean(true);
72 
73  Assert.IsFalse(value1.IsNull);
74  Assert.IsFalse(value2.IsNull);
75 
76  Assert.IsTrue(value1.IsComparableTo(value2));
77 
78  int i = -2;
79  Assert.DoesNotThrow(() => i = value1.CompareTo(value2));
80  Assert.AreEqual(-1, i);
81  }
Deveel.Data.Sql.Objects.SqlBoolean SqlBoolean
Definition: DataObject.cs:26
void Deveel.Data.Sql.Objects.SqlBooleanTest.Compare_ToBooleanNull ( )
inline

Definition at line 85 of file SqlBooleanTest.cs.

85  {
86  var value1 = SqlBoolean.True;
87  var value2 = SqlBoolean.Null;
88 
89  Assert.IsFalse(value1.IsNull);
90  Assert.IsTrue(value2.IsNull);
91 
92  Assert.IsTrue(value1.IsComparableTo(value2));
93 
94  int i = -2;
95  Assert.DoesNotThrow(() => i = value1.CompareTo(value2));
96  Assert.AreEqual(1, i);
97  }
void Deveel.Data.Sql.Objects.SqlBooleanTest.Compare_ToNull ( )
inline

Definition at line 101 of file SqlBooleanTest.cs.

101  {
102  var value1 = SqlBoolean.True;
103  var value2 = SqlNull.Value;
104 
105  Assert.IsFalse(value1.IsNull);
106  Assert.IsTrue(value2.IsNull);
107 
108  Assert.IsTrue(value1.IsComparableTo(value2));
109 
110  int i = -2;
111  Assert.DoesNotThrow(() => i = value1.CompareTo(value2));
112  Assert.AreEqual(1, i);
113  }
void Deveel.Data.Sql.Objects.SqlBooleanTest.Compare_ToNumber_InRange ( )
inline

Definition at line 118 of file SqlBooleanTest.cs.

118  {
119  var value1 = SqlBoolean.True;
120  var value2 = SqlNumber.One;
121 
122  Assert.IsFalse(value1.IsNull);
123  Assert.IsFalse(value2.IsNull);
124 
125  Assert.IsTrue(value1.IsComparableTo(value2));
126 
127  int i = -2;
128  Assert.DoesNotThrow(() => i = value1.CompareTo(value2));
129  Assert.AreEqual(0, i);
130 
131  value2 = SqlNumber.Zero;
132 
133  Assert.IsFalse(value1.IsNull);
134  Assert.IsFalse(value2.IsNull);
135 
136  Assert.IsTrue(value1.IsComparableTo(value2));
137 
138  i = -2;
139  Assert.DoesNotThrow(() => i = value1.CompareTo(value2));
140  Assert.AreEqual(1, i);
141  }
void Deveel.Data.Sql.Objects.SqlBooleanTest.Compare_ToNumber_OutOfRange ( )
inline

Definition at line 146 of file SqlBooleanTest.cs.

146  {
147  var value1 = SqlBoolean.True;
148  var value2 = new SqlNumber(21);
149 
150  Assert.IsFalse(value1.IsNull);
151  Assert.IsFalse(value2.IsNull);
152 
153  Assert.IsFalse(value1.IsComparableTo(value2));
154 
155  int i = -2;
156  Assert.Throws<ArgumentOutOfRangeException>(() => i = value1.CompareTo(value2));
157  Assert.AreEqual(-2, i);
158  }
void Deveel.Data.Sql.Objects.SqlBooleanTest.Convert_ToString ( )
inline

Definition at line 193 of file SqlBooleanTest.cs.

193  {
194  var value = SqlBoolean.True;
195  Assert.AreEqual("true", value.ToString());
196 
197  value = SqlBoolean.False;
198  Assert.AreEqual("false", value.ToString());
199 
200  value = SqlBoolean.Null;
201  Assert.AreEqual("NULL", value.ToString());
202  }
void Deveel.Data.Sql.Objects.SqlBooleanTest.CreateFromBoolean ( )
inline

Definition at line 39 of file SqlBooleanTest.cs.

39  {
40  var value = new SqlBoolean(true);
41  Assert.IsNotNull(value);
42  Assert.IsFalse(value.IsNull);
43  Assert.AreEqual(true, (bool)value);
44 
45  value = new SqlBoolean(false);
46  Assert.IsNotNull(value);
47  Assert.IsFalse(value.IsNull);
48  Assert.AreEqual(false, (bool)value);
49  }
Deveel.Data.Sql.Objects.SqlBoolean SqlBoolean
Definition: DataObject.cs:26
void Deveel.Data.Sql.Objects.SqlBooleanTest.CreateFromByte ( )
inline

Definition at line 26 of file SqlBooleanTest.cs.

26  {
27  var value = new SqlBoolean(1);
28  Assert.IsNotNull(value);
29  Assert.IsFalse(value.IsNull);
30  Assert.AreEqual(true, (bool)value);
31 
32  value = new SqlBoolean(0);
33  Assert.IsNotNull(value);
34  Assert.IsFalse(value.IsNull);
35  Assert.AreEqual(false, (bool)value);
36  }
Deveel.Data.Sql.Objects.SqlBoolean SqlBoolean
Definition: DataObject.cs:26
void Deveel.Data.Sql.Objects.SqlBooleanTest.Equality_False ( )
inline

Definition at line 171 of file SqlBooleanTest.cs.

171  {
172  var value1 = SqlBoolean.True;
173  var value2 = SqlBoolean.False;
174 
175  Assert.IsTrue(value1 != value2);
176 
177  value2 = SqlBoolean.Null;
178 
179  Assert.IsTrue(value1 != value2);
180  }
void Deveel.Data.Sql.Objects.SqlBooleanTest.Equality_ToNull_True ( )
inline

Definition at line 184 of file SqlBooleanTest.cs.

184  {
185  var value1 = SqlBoolean.Null;
186  var value2 = SqlNull.Value;
187 
188  Assert.IsTrue(value1 == value2);
189  }
void Deveel.Data.Sql.Objects.SqlBooleanTest.Equality_True ( )
inline

Definition at line 162 of file SqlBooleanTest.cs.

162  {
163  var value1 = SqlBoolean.True;
164  var value2 = SqlBoolean.True;
165 
166  Assert.IsTrue(value1 == value2);
167  }

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