代码检查:NUnit。 测试用例 Result 属性与 ExpectedResult 重复。
从 NUnit 2.6.2 开始, TestCase 属性的命名参数 结果 已被弃用,建议使用 ExpectedResult 参数,它具有相同的功能。
从 NUnit 3.0 开始, 结果 不再受支持,任何使用此参数的测试都无法在 NUnit 3.0 中编译。
如果在 TestCase 的属性中意外同时使用了 结果 和 ExpectedResult ,则 结果 是多余的,应将其移除。
// 'Result' is redundant and should be removed
[TestCase(12, 3, Result = 4, ExpectedResult = 4)]
public int DivideTest(int n, int d)
{
return (n / d);
}
最后修改日期: 2025年 9月 26日