Skip to content

Commit

Permalink
Linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
manfred-brands committed Nov 4, 2023
1 parent 8ead779 commit a5d781f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions docs/articles/nunit/release-notes/Nunit4.0-MigrationGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ uid: nunit40migrationguide

# NUnit 4.0 Migration Guide

NUnit 4.0 has a few [breaking changes](../release-notes/breaking-changes.md#NUnit-40)
NUnit 4.0 has a few [breaking changes](../release-notes/breaking-changes.md#nunit-40)
making it neither binary nor source code compatible with NUnit 3.14.0

* Change to [Classic Asserts](../writing-tests/assertions/assertion-models/classic.md)
Expand Down Expand Up @@ -99,10 +99,12 @@ depending on what version of `nunit` you are compiling with.

If you _only_ use classic asserts, you can get away with a couple of global substitutes:

1. Convert `using NUnit.Framework;` into _both_ `using NUnit.Framework;using NUnit.Framework.Legacy;`<br>
Depending on your editor you can automatically insert a newline between the two `using` statements.
1. Convert `Assert` into `ClassicAssert`.<br>
This global substitute will also convert those asserts that have not changed.
1. Convert `using NUnit.Framework;` into _both_ `using NUnit.Framework;using NUnit.Framework.Legacy;`

Depending on your editor you can automatically insert a newline between the two `using` statements.
1. Convert `Assert` into `ClassicAssert`.

This global substitute will also convert those asserts that have not changed.
You can narrow the scope of this substitute to do only the asserts that need converting, but there are quite a lot.

1. Convert `Assert.AreEqual` into `ClassicAssert.AreEqual`.
Expand Down Expand Up @@ -136,7 +138,7 @@ Note that this doesn't mean you have to target .NET 6.0. This also works if targ
## Assert.That with _format_ specification and `params` overload conversion

These overloads were removed to allow for better messages in case of failure.
See [Towards-NUnit4.md](../Towards-NUnit4.md#Improved-Assert-Result-Messages)
See [Towards-NUnit4.md](../Towards-NUnit4.md#improved-assert-result-messages)

NUnit4 has been optimized such that these formattable strings only get formatted in case the test is failing.

Expand Down
2 changes: 1 addition & 1 deletion docs/articles/nunit/release-notes/breaking-changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ uid: breakingchanges
## NUnit 4.0

* The [Classic Asserts](../writing-tests/assertions/assertion-models/classic.md) have been moved to a separate library and their namespace and their class name were renamed to: `NUnit.Framework.Legacy.ClassicAssert`.
* The standalone assert classes have also been moved to the `Legacy` subnamespace. These classes are:
* The standalone assert classes have also been moved to the `NUnit.Framework.Legacy` namespace. These classes are:
* [CollectionAssert](../writing-tests/assertions/classic-assertions/Collection-Assert.md)
* [StringAssert](../writing-tests/assertions/classic-assertions/String-Assert.md)
* [DirectoryAssert](../writing-tests/assertions/classic-assertions/Directory-Assert.md)
Expand Down

0 comments on commit a5d781f

Please sign in to comment.