Open martin-strecker-sonarsource opened 9 months ago
With NUnit 4.0 the assertion methods are moved to a different type and namespace: https://docs.nunit.org/articles/nunit/release-notes/Nunit4.0-MigrationGuide.html#convert-classic-assert-into-nunit-4x-equivalent
We need to add support for the ClassicAssert in the NUnit.Framework;using NUnit.Framework.Legacy namespace in the following rules:
ClassicAssert
NUnit.Framework;using NUnit.Framework.Legacy
S3415, S2701, S2699, S2187 Other rules that might be affected:
ClassicAssert.AreEqual(str, "");
S3415 raises, because expected and actual are swapped.
The issue is not raised.
None.
See also #8410 for more details.
This does not impact S3431, ExpectedExceptionAttribute has been removed since (at least) NUnit 2.9.7.
ExpectedExceptionAttribute
Description
With NUnit 4.0 the assertion methods are moved to a different type and namespace: https://docs.nunit.org/articles/nunit/release-notes/Nunit4.0-MigrationGuide.html#convert-classic-assert-into-nunit-4x-equivalent
We need to add support for the
ClassicAssert
in theNUnit.Framework;using NUnit.Framework.Legacy
namespace in the following rules:S3415, S2701, S2699, S2187 Other rules that might be affected:
Repro steps for S3415
ClassicAssert.AreEqual(str, "");
Expected behavior
S3415 raises, because expected and actual are swapped.
Actual behavior
The issue is not raised.
Known workarounds
None.
Related information
See also #8410 for more details.