nunit / nunit-console

NUnit Console runner and test engine
MIT License
215 stars 151 forks source link

Update most tests to use the latest version of the nunit framework #1478

Closed CharliePoole closed 1 day ago

CharliePoole commented 4 days ago

Most of our test and testdata projects use version 3.13.3 of the NUnit engine. A few projects used only for package testing use version 4.1.

Ideally, all the tests of our own code should use the latest version of the framework. Most projects used as test data should do the same although we should retain enough that use older versions so that we are verifying continued backward compatibility.

I'll also update NSubstitute as needed to work with each version of NUnit.

This issue will probably be resolved using multiple PRs.

CharliePoole commented 1 day ago

After some experimentation, I have a plan for mixing versions of NUnit in our tests by tying the version to the runtime target, as follows:

  1. Tests targeting .NET Framework 4.6.2 or higher or .NET 6.0 or higher will use NUnit 4.1 initially (because some tests already use it) and will be upgraded to NUnit 4.2.2 in the next step.
  2. Tests targeting older runtimes will use NUnit 3.14
  3. As an exception, tests using the V2 Framework driver will use NUnit 2.6.4

As an initial step, in order to simplify the upgrade process, I'll move those test assemblies we use for test targets (e.g. mock-assembly) to a separate output directory.