gambas-source-code/main/lib/test/gb.test/.src/TestMyself/TestSetup.test
gambas 5004f20609 Move 'gb.test' sources in '/main/lib'.
[INTERPRETER]
* NEW: Remove the now useless testing specific code.
* NEW: 'gbx3 -T' now just loads the 'gb.test' component and calls Test.Main() passing it the '-T' option argument.

[GB.TEST]
* NEW: Move 'gb.test' sources in '/main/lib'.
* NEW: 'gb.test' has now a part written in C that allows him to load project classes on demand.
2020-05-25 21:24:28 +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