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

Public Member Functions

void Create_FromInteger ()
 
void Create_FromBigInt ()
 
void Create_FromDouble ()
 
void Parse_BigDecimal ()
 
void Convert_ToBoolean_Success ()
 
void Integer_Greater_True ()
 

Static Public Member Functions

static void BigNumber_Greater_True ()
 

Detailed Description

Definition at line 24 of file SqlNumberTests.cs.

Member Function Documentation

static void Deveel.Data.Sql.Objects.SqlNumberTests.BigNumber_Greater_True ( )
inlinestatic

Definition at line 88 of file SqlNumberTests.cs.

88  {
89  var value1 = SqlNumber.Parse("98356278.911288837773848500069994933229238e45789");
90  var value2 = SqlNumber.Parse("348299.01991828833333333333488888388829911182227373738488847112349928");
91 
92  Assert.IsTrue(value1 > value2);
93  }
void Deveel.Data.Sql.Objects.SqlNumberTests.Convert_ToBoolean_Success ( )
inline

Definition at line 72 of file SqlNumberTests.cs.

72  {
73  var value = SqlNumber.One;
74  var b = new SqlBoolean();
75  Assert.DoesNotThrow(() => b = (SqlBoolean)Convert.ChangeType(value, typeof(SqlBoolean)));
76  Assert.IsTrue(b);
77  }
Deveel.Data.Sql.Objects.SqlBoolean SqlBoolean
Definition: DataObject.cs:26
void Deveel.Data.Sql.Objects.SqlNumberTests.Create_FromBigInt ( )
inline

Definition at line 38 of file SqlNumberTests.cs.

38  {
39  var value = new SqlNumber(4599356655L);
40  Assert.IsFalse(value.IsNull);
41  Assert.IsFalse(value.CanBeInt32);
42  Assert.IsTrue(value.CanBeInt64);
43  Assert.AreEqual(0, value.Scale);
44  Assert.AreEqual(10, value.Precision);
45  Assert.AreEqual(NumericState.None, value.State);
46  Assert.AreEqual(1, value.Sign);
47  }
NumericState
Lists all the possible special states of a number.
Definition: NumericState.cs:21
void Deveel.Data.Sql.Objects.SqlNumberTests.Create_FromDouble ( )
inline

Definition at line 50 of file SqlNumberTests.cs.

50  {
51  var value = new SqlNumber(459935.9803d);
52  Assert.IsFalse(value.IsNull);
53  Assert.IsFalse(value.CanBeInt32);
54  Assert.IsFalse(value.CanBeInt64);
55  Assert.AreEqual(28, value.Scale);
56  Assert.AreEqual(34, value.Precision);
57  Assert.AreEqual(NumericState.None, value.State);
58  Assert.AreEqual(1, value.Sign);
59  }
NumericState
Lists all the possible special states of a number.
Definition: NumericState.cs:21
void Deveel.Data.Sql.Objects.SqlNumberTests.Create_FromInteger ( )
inline

Definition at line 26 of file SqlNumberTests.cs.

26  {
27  var value = new SqlNumber((int) 45993);
28  Assert.IsFalse(value.IsNull);
29  Assert.IsTrue(value.CanBeInt32);
30  Assert.IsTrue(value.CanBeInt64);
31  Assert.AreEqual(0, value.Scale);
32  Assert.AreEqual(5, value.Precision);
33  Assert.AreEqual(NumericState.None, value.State);
34  Assert.AreEqual(1, value.Sign);
35  }
NumericState
Lists all the possible special states of a number.
Definition: NumericState.cs:21
void Deveel.Data.Sql.Objects.SqlNumberTests.Integer_Greater_True ( )
inline

Definition at line 80 of file SqlNumberTests.cs.

80  {
81  var value1 = new SqlNumber(76);
82  var value2 = new SqlNumber(54);
83 
84  Assert.IsTrue(value1 > value2);
85  }
void Deveel.Data.Sql.Objects.SqlNumberTests.Parse_BigDecimal ( )
inline

Definition at line 62 of file SqlNumberTests.cs.

62  {
63  var value = new SqlNumber();
64  Assert.DoesNotThrow(() => value = SqlNumber.Parse("98356278.911288837773848500069994933229238e45789"));
65  Assert.IsFalse(value.IsNull);
66  Assert.IsFalse(value.CanBeInt32);
67  Assert.IsFalse(value.CanBeInt64);
68  Assert.Greater(value.Precision, 40);
69  }

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