2017-04-14 18:30:13 +02:00
|
|
|
Option VBASupport 1
|
|
|
|
Option Explicit
|
|
|
|
|
|
|
|
Function doUnitTest() As String
|
2020-12-16 22:28:02 +00:00
|
|
|
verify_testLen
|
|
|
|
doUnitTest = TestUtilModule.GetResult()
|
2017-04-14 18:30:13 +02:00
|
|
|
End Function
|
|
|
|
|
2020-12-16 22:28:02 +00:00
|
|
|
Sub verify_testLen()
|
2017-04-14 18:30:13 +02:00
|
|
|
|
2020-12-16 22:28:02 +00:00
|
|
|
TestUtilModule.TestInit
|
2017-04-14 18:30:13 +02:00
|
|
|
|
|
|
|
Dim testName As String
|
|
|
|
Dim date1, date2
|
|
|
|
testName = "Test Len function"
|
|
|
|
On Error GoTo errorHandler
|
|
|
|
|
|
|
|
date2 = 8
|
|
|
|
date1 = Len("sometext")
|
2020-12-16 22:28:02 +00:00
|
|
|
TestUtilModule.AssertTrue(date1 = date2, "the return Len is: " & date1)
|
2017-04-14 18:30:13 +02:00
|
|
|
|
|
|
|
date2 = 9
|
|
|
|
date1 = Len("some text")
|
2020-12-16 22:28:02 +00:00
|
|
|
TestUtilModule.AssertTrue(date1 = date2, "the return Len is: " & date1)
|
2017-04-14 18:30:13 +02:00
|
|
|
|
|
|
|
date2 = 0
|
|
|
|
date1 = Len("")
|
2020-12-16 22:28:02 +00:00
|
|
|
TestUtilModule.AssertTrue(date1 = date2, "the return Len is: " & date1)
|
2017-04-14 18:30:13 +02:00
|
|
|
|
2020-12-16 22:28:02 +00:00
|
|
|
TestUtilModule.TestEnd
|
2017-04-14 18:30:13 +02:00
|
|
|
|
2020-12-16 22:28:02 +00:00
|
|
|
Exit Sub
|
2017-04-14 18:30:13 +02:00
|
|
|
errorHandler:
|
2020-12-16 22:28:02 +00:00
|
|
|
TestUtilModule.AssertTrue(False, testName & ": hit error handler")
|
2017-04-14 18:30:13 +02:00
|
|
|
End Sub
|
|
|
|
|