本文介绍了如何忽略运行测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Assert.Ignore 用于忽略 Nunit 中的测试.

Assert.Ignore is used to ignore a test in Nunit.

但是,在我的情况下,我运行测试,如果它们有,例如,错误代码 2,我可能会选择暂时忽略结果,但我仍然希望将其计入运行测试的数量.但是有没有办法说结果被忽略了,既不是失败也不是成功.

However, in my case I run tests, and if they have, for example, error code 2, I may choose to ignore the result for a while, but I still want it to be counted in the number of run test. But is there just a way to say the result is ignored, neither a failure or a success.

在我想要的 *.xml 中

In the *.xml I'd like to have

result="忽略"

result="Ignored"

executed="True"

推荐答案

我现在使用的是 Assert.Inconclusive(),executed="True",所以它最接近我想要的.

I use for now Assert.Inconclusive(), executed="True", so it's the closest to what I wanted.

如果有人发现更好,请随时发布.

If someone finds better, feel free to post.

这篇关于如何忽略运行测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 14:59