TestRunner对象存在一个run()方法,它接收一个TestCase对象或TestSuit对象作为参数,返回测试的结果对象(TestResult) 二、编写最简单的测试代码 下面是一个数学操作的类,包含加法和除法操作。
基于4个网页-相关网页
TestResult Objects 测试结果对象
Using Assert.assert{something}(..) ties TestCase to TestResult more deeply and hides the flexibility of a collecting parameter.
可以使用 Assert.assert{something}(..) 将 TestCase 绑到 TestResult 上,进一步限制收集参数的灵活性。
When the assertions fail, the methods throw AssertionFailedError, which TestResult catches and interprets in the result-handling fixture template method.
如果断言失败,那么这些方法将抛出AssertionFailedError, TestResult在结果处理装置模板方法中捕获这些异常并进行解释。
应用推荐