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

Public Member Functions

void Add_TimeSpan_NoDays ()
 
void Subtract_TimeSpan_NoDays ()
 
void Add_MonthSpan ()
 
void Subtract_MonthSpan ()
 
void Operator_Add_TimeSpan ()
 
void Operator_Subtract_TimeSpan ()
 
void Equality_True ()
 
void Inequality_True ()
 
void Greater_True ()
 

Detailed Description

Definition at line 24 of file SqlDateTimeTests.cs.

Member Function Documentation

void Deveel.Data.Sql.Objects.SqlDateTimeTests.Add_MonthSpan ( )
inline

Definition at line 59 of file SqlDateTimeTests.cs.

59  {
60  var value = new SqlDateTime(2001, 11, 03, 10, 22, 03, 0);
61  var ms = new SqlYearToMonth(1, 3);
62 
63  var result = new SqlDateTime();
64  Assert.DoesNotThrow(() => result = value.Add(ms));
65  Assert.IsFalse(result.IsNull);
66  Assert.AreEqual(2003, result.Year);
67  Assert.AreEqual(02, result.Month);
68  Assert.AreEqual(10, result.Hour);
69  Assert.AreEqual(22, result.Minute);
70  Assert.AreEqual(03, result.Second);
71  Assert.AreEqual(0, result.Millisecond);
72  }
void Deveel.Data.Sql.Objects.SqlDateTimeTests.Add_TimeSpan_NoDays ( )
inline

Definition at line 27 of file SqlDateTimeTests.cs.

27  {
28  var value = new SqlDateTime(2001, 01, 03, 10, 22, 03, 0);
29  var ts = new SqlDayToSecond(0, 2, 03, 0);
30 
31  var result = new SqlDateTime();
32  Assert.DoesNotThrow(() => result = value.Add(ts));
33  Assert.IsFalse(result.IsNull);
34  Assert.AreEqual(2001, result.Year);
35  Assert.AreEqual(01, result.Month);
36  Assert.AreEqual(03, result.Day);
37  Assert.AreEqual(12, result.Hour);
38  Assert.AreEqual(25, result.Minute);
39  }
void Deveel.Data.Sql.Objects.SqlDateTimeTests.Equality_True ( )
inline

Definition at line 127 of file SqlDateTimeTests.cs.

127  {
128  var value1 = new SqlDateTime(2030, 03, 01, 11, 05, 54, 0);
129  var value2 = new SqlDateTime(2030, 03, 01, 11, 05, 54, 0);
130 
131  Assert.IsTrue(value1 == value2);
132  }
void Deveel.Data.Sql.Objects.SqlDateTimeTests.Greater_True ( )
inline

Definition at line 145 of file SqlDateTimeTests.cs.

145  {
146  var value1 = new SqlDateTime(2030, 03, 01, 11, 05, 54, 0);
147  var value2 = new SqlDateTime(2020, 05, 01, 11, 05, 54, 0);
148 
149  Assert.IsTrue(value1 > value2);
150  }
void Deveel.Data.Sql.Objects.SqlDateTimeTests.Inequality_True ( )
inline

Definition at line 136 of file SqlDateTimeTests.cs.

136  {
137  var value1 = new SqlDateTime(2030, 03, 01, 11, 05, 54, 0);
138  var value2 = new SqlDateTime(2020, 05, 01, 11, 05, 54, 0);
139 
140  Assert.IsTrue(value1 != value2);
141  }
void Deveel.Data.Sql.Objects.SqlDateTimeTests.Operator_Add_TimeSpan ( )
inline

Definition at line 94 of file SqlDateTimeTests.cs.

94  {
95  var value = new SqlDateTime(2001, 01, 03, 10, 22, 03, 0);
96  var ts = new SqlDayToSecond(0, 2, 03, 0);
97 
98  var result = new SqlDateTime();
99  Assert.DoesNotThrow(() => result = value + ts);
100  Assert.IsFalse(result.IsNull);
101  Assert.AreEqual(2001, result.Year);
102  Assert.AreEqual(01, result.Month);
103  Assert.AreEqual(03, result.Day);
104  Assert.AreEqual(12, result.Hour);
105  Assert.AreEqual(25, result.Minute);
106  }
void Deveel.Data.Sql.Objects.SqlDateTimeTests.Operator_Subtract_TimeSpan ( )
inline

Definition at line 111 of file SqlDateTimeTests.cs.

111  {
112  var value = new SqlDateTime(2001, 01, 03, 10, 22, 03, 0);
113  var ts = new SqlDayToSecond(0, 2, 03, 0);
114 
115  var result = new SqlDateTime();
116  Assert.DoesNotThrow(() => result = value - ts);
117  Assert.IsFalse(result.IsNull);
118  Assert.AreEqual(2001, result.Year);
119  Assert.AreEqual(01, result.Month);
120  Assert.AreEqual(03, result.Day);
121  Assert.AreEqual(8, result.Hour);
122  Assert.AreEqual(19, result.Minute);
123  }
void Deveel.Data.Sql.Objects.SqlDateTimeTests.Subtract_MonthSpan ( )
inline

Definition at line 76 of file SqlDateTimeTests.cs.

76  {
77  var value = new SqlDateTime(2001, 11, 03, 10, 22, 03, 0);
78  var ms = new SqlYearToMonth(1, 3);
79 
80  var result = new SqlDateTime();
81  Assert.DoesNotThrow(() => result = value.Subtract(ms));
82  Assert.IsFalse(result.IsNull);
83  Assert.AreEqual(2000, result.Year);
84  Assert.AreEqual(08, result.Month);
85  Assert.AreEqual(10, result.Hour);
86  Assert.AreEqual(22, result.Minute);
87  Assert.AreEqual(03, result.Second);
88  Assert.AreEqual(0, result.Millisecond);
89  }
void Deveel.Data.Sql.Objects.SqlDateTimeTests.Subtract_TimeSpan_NoDays ( )
inline

Definition at line 43 of file SqlDateTimeTests.cs.

43  {
44  var value = new SqlDateTime(2001, 01, 03, 10, 22, 03, 0);
45  var ts = new SqlDayToSecond(0, 2, 03, 0);
46 
47  var result = new SqlDateTime();
48  Assert.DoesNotThrow(() => result = value.Subtract(ts));
49  Assert.IsFalse(result.IsNull);
50  Assert.AreEqual(2001, result.Year);
51  Assert.AreEqual(01, result.Month);
52  Assert.AreEqual(03, result.Day);
53  Assert.AreEqual(8, result.Hour);
54  Assert.AreEqual(19, result.Minute);
55  }

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