gb.test: fix Assert.ErrorCode and Teardown spelling

[GB.TEST]
* BUG: Forward Description in Assert.ErrorCode.
* BUG: Fix spelling of TearDown -> Teardown special test method.
* OPT: Use Assert.Note() instead of Print in tests.
This commit is contained in:
Tobias Boege 2020-04-07 14:18:59 +02:00
parent 71b5ca1244
commit 6144a78829
3 changed files with 7 additions and 7 deletions

View file

@ -376,7 +376,7 @@ Public Sub ErrorCode(Code As Integer, Optional Description As String) As Boolean
bRes = Fail(Description)
Note(("No error happened"))
Else
bRes = Equals(Error.Code, Code)
bRes = Equals(Error.Code, Code, Description)
If Not bRes Then
Note(Subst$(("Error was: &1 (code: &2) at &3"), Error.Text, Error.Code, Error.Where))
Endif

View file

@ -6,25 +6,25 @@ Public Const ThisIsAnUnitTestSelfTest As Boolean = True
Public Sub Setup()
Print "# Setup TestModule"
Assert.Note("Setup TestModule")
End
Public Sub Teardown()
Print "# Teardown TestModule"
Assert.Note("Teardown TestModule")
End
Public Sub SetupEach()
Print "# Setup Each"
Assert.Note("Setup Each")
End
Public Sub TeardownEach()
Print "# Teardown Each"
Assert.Note("Teardown Each")
End

View file

@ -64,8 +64,8 @@ Private Sub StopTestModule(TestModule As Class)
Dim Plan As Integer
If TestModule.Symbols.Exist("TearDown") Then
Object.Call(TestModule, "TearDown")
If TestModule.Symbols.Exist("Teardown") Then
Object.Call(TestModule, "Teardown")
Endif
End