当我在拆解中使用Assert.Pass()时,它会将测试用例标记为失败?我正在使用LatestNunit版本
在升级nUnit之前它工作正常!
答案 0 :(得分:0)
TearDown
显然不支持ResultStateExceptions - 请参阅源代码中的此注释。
/// <summary>
/// RecordTearDownException appends the message and stacktrace
/// from an exception arising during teardown of the test
/// to any previously recorded information, so that any
/// earlier failure information is not lost. Note that
/// calling Assert.Ignore, Assert.Inconclusive, etc. during
/// teardown is treated as an error. If the current result
/// represents a suite, it may show a teardown error even
/// though all contained tests passed.
/// </summary>
这似乎是明智的 - 我不确定你想要强迫你的失败测试显示为传递的情况是什么?如果你有一个真正的用例,我建议发布一个Github问题来讨论它作为一个功能,但它听起来不是理想的方法。