Closed robodude666 closed 6 years ago
Thanks for the suggestion, I've added IsError
and NotError
. I tried passing in Err
, but it converts it to just the error number when you pass it around, so instead they just check the current global Err
.
.IsError
.IsError vbObjectError + 1
.IsError Source:="..."
.IsError Description:="..."
.IsError vbObjectError + 1, "Source", "Description"
.NotError
Closed by https://github.com/VBA-tools/vba-test/commit/d58af6ed603b417c8f708db99dbdc19112a890e6
It would be useful to be able to assert the
Err
object and ensure that either no error occurred as expected, or that the expected error was called:Of course, the naming of
ToNotBeError
andToBeError
are only examples. It may be possible to build them intoIsOk
andNotOk
, but I'd prefer a dedicated method withErr
orError
in the name for clarity.