1
是否有一种习惯用法,它不会重复代码,并在单元测试时检查Io中是否抛出异常?测试预期的异常是否在Io中抛出
到目前为止:
threw := false
e := try(_method that should throw_)
e catch(Exception, threw = true)
if(threw not, fail("Should have thrown an Exception, but did not!"))