gambas-source-code/main/lib/test/gb.test/.src/TestMyself/TSetup.test
Christof Thalhofer fc4525708a gb.test rename test modules
[GB.TEST]
* OPT: rename testmodules and methods in them, get rid of such a lot "Test"
2020-05-26 20:45:18 +02:00

53 lines
1.1 KiB
Text

' Gambas test file
'Plan is one more because Test in _TeardownEach is counted twice!
Private $SetupIsDone As Boolean
Private $EachSetupIsDone As Boolean
Public Sub _Setup()
$SetupIsDone = True
Test.Note("_Setup TestModule")
End
Public Sub _Teardown()
If Not $SetupIsDone Then
' will bail out if Test_Setup failed
Error.Raise("Test_Setup failed: _Setup was not executed correctly.")
Endif
Test.Note("Teardown TestModule")
End
Public Sub _SetupEach()
Assert.NotOk($EachSetupIsDone, "Check if each was not setup.")
$EachSetupIsDone = True
Test.Note("_Setup Each")
End
Public Sub _TeardownEach()
Assert.Ok($EachSetupIsDone, "Each setup done")
Test.Note("Teardown Each")
$EachSetupIsDone = False
End
Public Sub TestFirst()
Assert.Ok($SetupIsDone, "Check if setup was successful.")
Assert.Ok($EachSetupIsDone, "Check if setup each was successful.")
Assert.StringEquals("ja", "ja", "Fake test")
End
Public Sub NameOfMethodDoesNotStartWithTest()
Assert.StringEquals("no", "no", "Fake test")
End