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

Public Member Functions

void Integer_Create ()
 
void BigInt_Create ()
 
void Integer_Compare_Equal ()
 
void Integer_Compare_NotEqual ()
 
void Integer_Convert_ToDouble ()
 
void Integer_Convert_ToVarChar ()
 
void Integer_Convert_ToBoolean ()
 

Detailed Description

Definition at line 27 of file NumericObjectTests.cs.

Member Function Documentation

void Deveel.Data.NumericObjectTests.BigInt_Create ( )
inline

Definition at line 38 of file NumericObjectTests.cs.

38  {
39  var obj = DataObject.BigInt(8399902L);
40  Assert.IsNotNull(obj);
41  Assert.IsInstanceOf<NumericType>(obj.Type);
42  Assert.AreEqual(SqlTypeCode.BigInt, obj.Type.TypeCode);
43  Assert.AreEqual(8399902L, obj);
44  }
SqlTypeCode
Enumerates the codes of all SQL types handled by the system.
Definition: SqlTypeCode.cs:23
void Deveel.Data.NumericObjectTests.Integer_Compare_Equal ( )
inline

Definition at line 47 of file NumericObjectTests.cs.

47  {
48  var obj1 = DataObject.Integer(33);
49  var obj2 = DataObject.Integer(33);
50 
51  Assert.IsNotNull(obj1);
52  Assert.IsNotNull(obj2);
53 
54  Assert.IsInstanceOf<NumericType>(obj1.Type);
55  Assert.IsInstanceOf<NumericType>(obj2.Type);
56 
57  Assert.AreEqual(SqlTypeCode.Integer, obj1.Type.TypeCode);
58  Assert.AreEqual(SqlTypeCode.Integer, obj2.Type.TypeCode);
59 
60  Assert.IsTrue(obj1.IsComparableTo(obj2));
61  Assert.AreEqual(0, obj1.CompareTo(obj2));
62  }
SqlTypeCode
Enumerates the codes of all SQL types handled by the system.
Definition: SqlTypeCode.cs:23
void Deveel.Data.NumericObjectTests.Integer_Compare_NotEqual ( )
inline

Definition at line 65 of file NumericObjectTests.cs.

65  {
66  var obj1 = DataObject.Integer(33);
67  var obj2 = DataObject.Integer(87);
68 
69  Assert.IsNotNull(obj1);
70  Assert.IsNotNull(obj2);
71 
72  Assert.IsInstanceOf<NumericType>(obj1.Type);
73  Assert.IsInstanceOf<NumericType>(obj2.Type);
74 
75  Assert.AreEqual(SqlTypeCode.Integer, obj1.Type.TypeCode);
76  Assert.AreEqual(SqlTypeCode.Integer, obj2.Type.TypeCode);
77 
78  Assert.IsTrue(obj1.IsComparableTo(obj2));
79  Assert.AreEqual(-1, obj1.CompareTo(obj2));
80  }
SqlTypeCode
Enumerates the codes of all SQL types handled by the system.
Definition: SqlTypeCode.cs:23
void Deveel.Data.NumericObjectTests.Integer_Convert_ToBoolean ( )
inline

Definition at line 113 of file NumericObjectTests.cs.

113  {
114  var obj = DataObject.Integer(1);
115  Assert.IsNotNull(obj);
116  Assert.IsInstanceOf<NumericType>(obj.Type);
117  Assert.AreEqual(SqlTypeCode.Integer, obj.Type.TypeCode);
118  Assert.AreEqual(1, obj);
119 
120  DataObject result = null;
121  Assert.DoesNotThrow(() => result = obj.AsBoolean());
122  Assert.IsNotNull(result);
123  Assert.IsInstanceOf<BooleanType>(result.Type);
124  Assert.IsTrue((SqlBoolean)result.Value);
125  }
SqlTypeCode
Enumerates the codes of all SQL types handled by the system.
Definition: SqlTypeCode.cs:23
void Deveel.Data.NumericObjectTests.Integer_Convert_ToDouble ( )
inline

Definition at line 83 of file NumericObjectTests.cs.

83  {
84  var obj = DataObject.Integer(33);
85  Assert.IsNotNull(obj);
86  Assert.IsInstanceOf<NumericType>(obj.Type);
87  Assert.AreEqual(SqlTypeCode.Integer, obj.Type.TypeCode);
88  Assert.AreEqual(33, obj);
89 
90  DataObject result = null;
91  Assert.DoesNotThrow(() => result = obj.CastTo(PrimitiveTypes.Numeric(SqlTypeCode.Double)));
92  Assert.IsNotNull(result);
93  Assert.IsInstanceOf<NumericType>(result.Type);
94  Assert.AreEqual(SqlTypeCode.Double, result.Type.TypeCode);
95  }
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.
Definition: SqlTypeCode.cs:23
void Deveel.Data.NumericObjectTests.Integer_Convert_ToVarChar ( )
inline

Definition at line 98 of file NumericObjectTests.cs.

98  {
99  var obj = DataObject.Integer(33);
100  Assert.IsNotNull(obj);
101  Assert.IsInstanceOf<NumericType>(obj.Type);
102  Assert.AreEqual(SqlTypeCode.Integer, obj.Type.TypeCode);
103  Assert.AreEqual(33, obj);
104 
105  DataObject result = null;
106  Assert.DoesNotThrow(() => result = obj.AsVarChar());
107  Assert.IsNotNull(result);
108  Assert.IsInstanceOf<StringType>(result.Type);
109  Assert.AreEqual("33", ((SqlString)result.Value).Value);
110  }
SqlTypeCode
Enumerates the codes of all SQL types handled by the system.
Definition: SqlTypeCode.cs:23
void Deveel.Data.NumericObjectTests.Integer_Create ( )
inline

Definition at line 29 of file NumericObjectTests.cs.

29  {
30  var obj = DataObject.Integer(33);
31  Assert.IsNotNull(obj);
32  Assert.IsInstanceOf<NumericType>(obj.Type);
33  Assert.AreEqual(SqlTypeCode.Integer, obj.Type.TypeCode);
34  Assert.AreEqual(33, obj);
35  }
SqlTypeCode
Enumerates the codes of all SQL types handled by the system.
Definition: SqlTypeCode.cs:23

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