2013-03-07 16:23:45 +00:00
|
|
|
Option VBASupport 1
|
|
|
|
Option Explicit
|
|
|
|
|
|
|
|
Function doUnitTest() As String
|
2020-12-16 22:28:02 +00:00
|
|
|
verify_testDateSerial
|
|
|
|
doUnitTest = TestUtilModule.GetResult()
|
2013-03-07 16:23:45 +00:00
|
|
|
End Function
|
|
|
|
|
2020-12-16 22:28:02 +00:00
|
|
|
Sub verify_testDateSerial()
|
2013-03-07 16:23:45 +00:00
|
|
|
Dim testName As String
|
|
|
|
Dim date1, date2 As Date
|
|
|
|
|
2020-12-16 22:28:02 +00:00
|
|
|
TestUtilModule.TestInit
|
2013-03-07 16:23:45 +00:00
|
|
|
|
|
|
|
testName = "Test DateSerial function"
|
|
|
|
date2 = 36326
|
2015-03-23 09:37:33 +00:00
|
|
|
|
2013-03-07 16:23:45 +00:00
|
|
|
On Error GoTo errorHandler
|
2015-03-23 09:37:33 +00:00
|
|
|
|
2013-03-07 16:23:45 +00:00
|
|
|
date1 = DateSerial(1999, 6, 15) '6/15/1999
|
2020-12-16 22:28:02 +00:00
|
|
|
TestUtilModule.AssertTrue(date1 = date2, "the return date is: " & date1)
|
2013-03-07 16:23:45 +00:00
|
|
|
date1 = DateSerial(2000, 1 - 7, 15) '6/15/1999
|
2020-12-16 22:28:02 +00:00
|
|
|
TestUtilModule.AssertTrue(date1 = date2, "the return date is: " & date1)
|
2013-03-07 16:23:45 +00:00
|
|
|
date1 = DateSerial(1999, 1, 166) '6/15/1999
|
2020-12-16 22:28:02 +00:00
|
|
|
TestUtilModule.AssertTrue(date1 = date2, "the return date is: " & date1)
|
|
|
|
TestUtilModule.TestEnd
|
2013-03-07 16:23:45 +00:00
|
|
|
|
2020-12-16 22:28:02 +00:00
|
|
|
Exit Sub
|
2013-03-07 16:23:45 +00:00
|
|
|
errorHandler:
|
2020-12-16 22:28:02 +00:00
|
|
|
TestUtilModule.AssertTrue(False, testName & ": hit error handler")
|
2013-03-07 16:23:45 +00:00
|
|
|
End Sub
|
|
|
|
|