Releases: nunit/nunit.analyzers
NUnit Analyzers 4.8.1 - May 29, 2025
NUnit Analyzers 4.8.1 - May 29, 2025
This release of the NUnit Analyzers fixes a problem with NUnit4002
when applied to comparisons between non-number
types - e.g. strings.
The release contains contributions from the following users (in alphabetical order):
Issues Resolved
Bugs
- #870 Compilation error caused by exception in an analyzer after updating to v4.8.0
NUnit Analyzers 4.8 - May 22, 2025
NUnit Analyzers 4.8 - May 22, 2025
This release of the NUnit Analyzers adds a new diagnostic NUnit1034
that checks
whether base TestFixtures are declared as abstract
. When a base class is not abstract
it will also be run as a standalone test which is most times not the intention.
The release also contains some fixes to NUnit4002
and Nunit2045
.
The release contains contributions from the following users (in alphabetical order):
Issues Resolved
Features and Enhancements
- #840 Detect incorrect or questionable use of TestFixture inheritance.
Bugs
- #862 NUnit.Analyzers doesn't recognize the version of NUnit in use
- #856 NUnit4002 shouldn't trigger for unknown types
Tooling, Process, and Documentation
NUnit Analyzers 4.7 - April 1, 2025
NUnit Analyzers 4.7 - April 1, 2025
The release primarily add another diagnostic NUnit4002
- and associated codefix - to help simplify
EqualTo
constraints when the expected value is a simple constant - e.g. true
, false
, 0
, or
default
. The release also removes some false positives for Nunit1029
.
As tooling contributions the analyzers now build using .NET8.0 and also analyzers and codefixes are
now split into separate projects as only editors should load codefixes.
The release contains contributions from the following users (in alphabetical order):
Issues Resolved
Features and Enhancements
- #828 Replace Is.EqualTo(default) with Is.Default
- #826 Suggest to use Is.Null instead of Is.EqualTo(null)
- #824 Use Is.False / Is.True instead of Is.EqualTo
Bugs
- #832 False positive for Nunit1029 when only a type argument is use
Tooling, Process, and Documentation
NUnit Analyzers 4.6 - January 9, 2025
NUnit Analyzers 4.6 - January 9, 2025
This release contains two improvements: Allowing NUnit1001
to understand DateOnly
and TimeOnly
parameters in
TestCaseUsage
and making NUnit2045
support Assert.EnterMultipleScope
(introduced in NUnit version 4.2).
The release contains contributions from the following users (in alphabetical order):
Issues Resolved
Features and Enhancements
- #820 NUnit1001 compains about DateOnly parameters
- #769 Recognized the new Assert.EnterMultipleScope() concept.
Tooling, Process, and Documentation
NUnit Analyzers 4.5 - December 22, 2024
NUnit Analyzers 4.5 - December 22, 2024
The release primarily fixes a problem with the NUnit Analyzers when used with NUnit 4.3.1 - see #811 for more
information. In additional, we have also added some smaller improvements and bug fixes.
The release contains contributions from the following users (in alphabetical order):
Issues Resolved
Features and Enhancements
Bugs
- #794 AD0001: Occasional InvalidOperationException error in analyzer in IDE
Tooling, Process, and Documentation
NUnit Analyzers 4.4 - November 13, 2024
NUnit Analyzers 4.4 - November 13, 2024
This release of the NUnit Analyzers adds handling of Assert.IsAssignableFrom
/Assert.IsNotAssignableFrom
and
Assert.Positive
/Assert.Negative
. Also insertion of trivia for code fixes for NUnit2007
and NUnit2046
have been improved.
The release contains contributions from the following users (in alphabetical order):
Issues Resolved
Features and Enhancements
- #790 NUnit.Analyzers 4.3.0 missed an Assert.IsAssignableFrom that caused a build error after upgrading to latest NUnit 4.2.2
- #789 NUnit.Analyzers 4.3.0 missed an Assert.Positive that caused a build error after upgrading to latest NUnit 4.2.2
Bugs
Tooling, Process, and Documentation
NUnit Analyzers 4.3 - August 9, 2024
NUnit Analyzers 4.3 - August 9, 2024
This release of the NUnit Analyzers contains some bug fixes to existing analyzers and code fixes - among other
improvements to trivia when using the code fix of NUnit2049.
For new features we now warn against using TestContext.Write
as this will be obsolete in NUnit at some point;
NUnit1001 now recognises and check generic TestCase attributes; and we have added a new analyzer and code fix for
simplifying usages of ValuesAttribute
.
The release contains contributions from the following users (in alphabetical order):
- @andrewimcclement
- @Bartleby2718
- @DrPepperBianco
- @KaiBNET
- @maettu-this
- @manfred-brands
- @mikkelbu
- @RenderMichael
- @SeanKilleen
- @trampster
Issues Resolved
Features and Enhancements
- #770 Add rule to detect calls to TestContext.Write methods and CodeFix to replace usages with Out.Write
- #767 Augment NUnit1001 to recognized and check generic TestCase attributes
- #755 New diagnostic: The Values attribute can be simplified.
Bugs
- #766 Error when TearDown method is defined in partial test classes - Syntax node is not within syntax tree
- #743 NUnit1032 (missing Dispose), if dispose is wrapped in "(… as IDisposable)?.Dispose()"
- #739 Null suppression does not work when Assert is fully qualified
- #713 Code fix for NUnit2049 places the comma at a wrong place and messes up indentation bug
Tooling, Process, and Documentation
- #764 Update the solution file
- #761 Update nunit.analyzers.nuspec to specify that NUnit.Analyzers v4 is intended to be used with NUnit 4.
- #756 error NUnit1032 is incorrect when InstancePerTestCase and constructor is used to initialize IDisposible
- #741 chore(deps): Bump Microsoft.NET.Test.Sdk from 17.9.0 to 17.10.0 in /src
- #737 Update NUnit2013.md to fix code block
- #736 chore: bump version
- #734 Why dropping composite message formatting support also for Assert.Pass/Fail/... where there are no actual and constraint parameters?
NUnit Analyzers 4.2 - April 24, 2024
NUnit Analyzers 4.2 - April 24, 2024
This release of the Analyzers extends NUnit2050 to also cover Assume
and Nunit1032 to consider dispose of a type
having explicit interface implementation. Furthermore, named parameters are now handled correctly codefixes for
classical asserts, and NUnit2010 improves the logic for determining Equals
methods.
The release contains contributions from the following users (in alphabetical order):
Issues Resolved
Features and Enhancements
- #731 Add test for wrapping conditional expression in parenthesis for NUnit2050
- #720 Replace UpdateStringFormatToFormattableString with String.Format
- #719 NUnit2050 should cover Assume
- #710 Nunit1032 - consider dispose of a type having explicit interface implementation
Bugs
- #728 NUnit2010 - do not consider Equals call if it doesn't override Object.Equals
- #712 [bug] Code fix for NUnit2005 does not correctly fix Assert.AreEqual if named parameters are used in unexpected order
Tooling, Process, and Documentation
NUnit Analyzers 4.1 - March 16, 2024
NUnit Analyzers 4.1 - March 16, 2024
This release of the Analyzers extends the suppression of nullable warnings to also respect assumptions -
expressed via Assume.That
. Also nullable warnings are suppressed even in the context of the
null-forgiving operator !
, and NUnit2010 is extended to also cover is
pattern expressions - e.g.
is null
and more general integer patterns as is < 0 or >= 1
.
The release contains contributions from the following users (in alphabetical order):
Issues Resolved
Features and Enhancements
- #693 Possibly Null Reference Warning should be suppressed for Assume
- #691 Extent rule NUnit2010 to detect 'is null'
- #679 Null suppression doesn't work when the body has a null suppression
Bugs
- #700 CodeFix for Assert with null message causes ambiguous code.
- #689 Incorrect constraint model transformation for named parameters
Tooling, Process, and Documentation
NUnit Analyzers 4.0.1 - February 1, 2024
NUnit Analyzers 4.0.1 - February 1, 2024
Small release that fixes a problem with the 4.0 release when combining TestCaseSource
and CancelAfter
.
The release contains contributions from the following users (in alphabetical order):
Issues Resolved
Bugs
- #685 error NUnit1029: The TestCaseSource provides '1' parameter(s), but the Test method expects '1' parameter(s)
Tooling, Process, and Documentation
- #684 chore: bump-version