rewrite tests for Assert.throwsError() to avoid false positive

And refactored a bit the assertion as well. The main issue here is that
the assertion was used to test itself which is obviously wrong.

So I rewrote the tests so that they test the behaviour
and not the implementation.