如何让 NUnit 在 Class 失败时停止执行测试
How to make NUnit stop executing tests in a Class on a failure
有什么方法可以让 NUnit 中止 运行 任何更多测试 ,因为 class 只有 当它遇到第一个错误时?我正在 运行 集成测试,使用 [Order] 属性。这些测试可能会变得非常冗长,并且在某些情况下,如果其中一项测试失败,则无需在 class 中继续进行 运行 测试。我希望 NUnit 继续其他 classes,但我希望它在指定的 class.
中中止调用任何更多 classes
有什么办法吗?
我正在使用 NUnit 3.2
谢谢!
嗡嗡声
目前没有任何方法可以在 class 出现第一个错误时停止执行测试。只有命令行选项 --stoponerror
会停止 运行 对第一个错误的所有测试。
Order
属性是 3.2 中的新属性。与其他框架不同,它仅用于订购测试,而不是为测试设置依赖项。 GitHub 上有一个开放增强功能,可满足您的要求 Test Dependency Attribute, but it hasn't been worked on because people cannot come to a consensus on the design. I think a good first step would be a variation of the Order
attribute with dependencies, but some people want a full dependency graph. I would recommend that you head over to GitHub and comment on the issue。
有什么方法可以让 NUnit 中止 运行 任何更多测试 ,因为 class 只有 当它遇到第一个错误时?我正在 运行 集成测试,使用 [Order] 属性。这些测试可能会变得非常冗长,并且在某些情况下,如果其中一项测试失败,则无需在 class 中继续进行 运行 测试。我希望 NUnit 继续其他 classes,但我希望它在指定的 class.
中中止调用任何更多 classes有什么办法吗?
我正在使用 NUnit 3.2
谢谢!
嗡嗡声
目前没有任何方法可以在 class 出现第一个错误时停止执行测试。只有命令行选项 --stoponerror
会停止 运行 对第一个错误的所有测试。
Order
属性是 3.2 中的新属性。与其他框架不同,它仅用于订购测试,而不是为测试设置依赖项。 GitHub 上有一个开放增强功能,可满足您的要求 Test Dependency Attribute, but it hasn't been worked on because people cannot come to a consensus on the design. I think a good first step would be a variation of the Order
attribute with dependencies, but some people want a full dependency graph. I would recommend that you head over to GitHub and comment on the issue。