2017-03-18 14:38:09 +01:00
|
|
|
Option VBASupport 1
|
|
|
|
Option Explicit
|
|
|
|
|
|
|
|
Function doUnitTest() As String
|
2020-12-16 22:28:02 +00:00
|
|
|
verify_testCVDate
|
|
|
|
' SKIPPED test due to CVDate not being available
|
|
|
|
'doUnitTest = TestUtilModule.GetResult()
|
|
|
|
doUnitTest = "OK"
|
2017-03-18 14:38:09 +01:00
|
|
|
End Function
|
|
|
|
|
2020-12-16 22:28:02 +00:00
|
|
|
Sub verify_testCVDate()
|
|
|
|
TestUtilModule.TestInit
|
2017-03-18 14:38:09 +01:00
|
|
|
|
|
|
|
Dim testName As String
|
|
|
|
Dim date1, date2 As Date 'variables for test
|
|
|
|
testName = "Test CVDate function"
|
|
|
|
On Error GoTo errorHandler
|
|
|
|
|
|
|
|
date2 = 25246
|
|
|
|
date1 = CVDate("12.2.1969") '2/12/1969
|
2020-12-16 22:28:02 +00:00
|
|
|
TestUtilModule.AssertTrue(date1 = date2, "the return CVDate is: " & date1)
|
2017-03-18 14:38:09 +01:00
|
|
|
|
|
|
|
date2 = 28313
|
|
|
|
date1 = CVDate("07/07/1977")
|
2020-12-16 22:28:02 +00:00
|
|
|
TestUtilModule.AssertTrue(date1 = date2, "the return CVDate is: " & date1)
|
2017-03-18 14:38:09 +01:00
|
|
|
|
|
|
|
date2 = 28313
|
|
|
|
date1 = CVDate(#7/7/1977#)
|
2020-12-16 22:28:02 +00:00
|
|
|
TestUtilModule.AssertTrue(date1 = date2, "the return CVDate is: " & date1)
|
2017-03-18 14:38:09 +01:00
|
|
|
|
2020-12-16 22:28:02 +00:00
|
|
|
TestUtilModule.TestEnd
|
2017-03-18 14:38:09 +01:00
|
|
|
|
2020-12-16 22:28:02 +00:00
|
|
|
Exit Sub
|
2017-03-18 14:38:09 +01:00
|
|
|
errorHandler:
|
2020-12-16 22:28:02 +00:00
|
|
|
TestUtilModule.AssertTrue(False, "ERROR", "#"& Str(Err.Number) &" at line"& Str(Erl) &" - "& Error$)
|
2017-03-18 14:38:09 +01:00
|
|
|
End Sub
|