Rerunning the test fails again, but this time because of the exception being thrown.
重新运行这些测试仍然失败,但是这一次是因为抛出了异常。
If no exception is thrown, the test passes.
若未抛出任何异常,测试即通过。
This is important to know if you are expecting your test to throw an exception.
在预料到测试会抛出异常时,这一点很重要。
We'll add some simple logic to make it easier to test the exception behavior.
我们将会添加一些简单的逻辑来简化异常的测试。
Everyone passed the math test, with the exception of Tom.
除了汤姆之外,所有人都通过了数学考试。
Everyone passed the math test, with the exception of Tom.
除了汤姆之外,所有人都通过了数学考试。
应用推荐