コードインスペクション:NUnit。 テストケースの Result プロパティが ExpectedResult と重複しています。
NUnit 2.6.2 から開始して、 TestCase 属性(英語)の名前付きパラメーター Result は、テストメソッドから返される期待される結果を指定するために使用できますが、同じ目的を果たす ExpectedResult パラメーターが推奨されます。
NUnit 3.0 以降、 Result はサポートされなくなり、このパラメーターを使用するテストは NUnit 3.0 でコンパイルされません。
Result と ExpectedResult の両方が TestCase の属性で誤って使用された場合、 Result は冗長であり、削除する必要があります。
// 'Result' is redundant and should be removed
[TestCase(12, 3, Result = 4, ExpectedResult = 4)]
public int DivideTest(int n, int d)
{
return (n / d);
}
2026 年 6 月 12 日