2017-08-02 18:24:18 +02:00
|
|
|
Option VBASupport 1
|
|
|
|
Option Explicit
|
|
|
|
|
|
|
|
Function doUnitTest() As String
|
2020-12-16 22:28:02 +00:00
|
|
|
verify_testSTR
|
|
|
|
doUnitTest = TestUtilModule.GetResult()
|
2017-08-02 18:24:18 +02:00
|
|
|
End Function
|
|
|
|
|
2020-12-16 22:28:02 +00:00
|
|
|
Sub verify_testSTR()
|
2017-08-02 18:24:18 +02:00
|
|
|
|
2020-12-16 22:28:02 +00:00
|
|
|
TestUtilModule.TestInit
|
2017-08-02 18:24:18 +02:00
|
|
|
|
|
|
|
Dim testName As String
|
|
|
|
Dim date1, date2
|
|
|
|
testName = "Test STR function"
|
|
|
|
On Error GoTo errorHandler
|
|
|
|
|
|
|
|
date2 = " 459"
|
|
|
|
date1 = Str(459)
|
2020-12-16 22:28:02 +00:00
|
|
|
TestUtilModule.AssertTrue(date1 = date2, "the return STR is: " & date1)
|
2017-08-02 18:24:18 +02:00
|
|
|
|
|
|
|
date2 = "-459.65"
|
|
|
|
date1 = Str(-459.65)
|
2020-12-16 22:28:02 +00:00
|
|
|
TestUtilModule.AssertTrue(date1 = date2, "the return STR is: " & date1)
|
2017-08-02 18:24:18 +02:00
|
|
|
|
|
|
|
date2 = " 459.001"
|
|
|
|
date1 = Str(459.001)
|
2020-12-16 22:28:02 +00:00
|
|
|
TestUtilModule.AssertTrue(date1 = date2, "the return STR is: " & date1)
|
2017-08-02 18:24:18 +02:00
|
|
|
|
|
|
|
date2 = " .24"
|
|
|
|
date1 = Str(0.24)
|
2020-12-16 22:28:02 +00:00
|
|
|
TestUtilModule.AssertTrue(date1 = date2, "the return STR is: " & date1)
|
2017-08-02 18:24:18 +02:00
|
|
|
|
2020-12-16 22:28:02 +00:00
|
|
|
TestUtilModule.TestEnd
|
2017-08-02 18:24:18 +02:00
|
|
|
|
2020-12-16 22:28:02 +00:00
|
|
|
Exit Sub
|
2017-08-02 18:24:18 +02:00
|
|
|
errorHandler:
|
2020-12-16 22:28:02 +00:00
|
|
|
TestUtilModule.AssertTrue(False, testName & ": hit error handler")
|
2017-08-02 18:24:18 +02:00
|
|
|
End Sub
|
|
|
|
|