Releases: nunit/nunit.analyzers
NUnit Analyzers 4.11.2 - November 2, 2025
NUnit Analyzers 4.11.2 - November 2, 2025
This release of the NUnit Analyzers fixes a problem in the NUnit2057 analyzer for unnecessary use of lambda
expressions. The release also extends NUnit2021 so that it can determining if Is.NaN or Is.Not.NaN constraints
are used on incompatible types.
The release contains contributions from the following users (in alphabetical order):
Issues Resolved
Features and Enhancements
- #929 Alert when using Is.NaN or Is.Not.NaN on an incompatible type
Bugs
- #945 [NUnit2057] Reported for Throws assert
NUnit Analyzers 4.11.1 - October 30, 2025
NUnit Analyzers 4.11.1 - October 30, 2025
This release of the NUnit Analyzers fixes a regression related to the analysis of nullable enum parameters in
NUnit1001 and NUnit1031. The release also contains a new analyzer and codefix for unnecessary usage of lambda
expressions in asserts.
The release contains contributions from the following users (in alphabetical order):
Issues Resolved
Features and Enhancements
- #927 Add new rule for unnecessary use of lambda expressions
Bugs
NUnit Analyzers 4.11 - October 28, 2025
NUnit Analyzers 4.11 - October 28, 2025
This release of the NUnit Analyzers includes improvements and fixes related to IDisposable handling and initialization
in SetUp and OneTimeSetUp methods. It also introduces the ability to configure additional methods that should be
treated as SetUp and TearDown methods by the analyzers. This can be done in the .editorconfig, and there are four
configurations for this:
dotnet_diagnostic.NUnit.additional_setup_methodsdotnet_diagnostic.NUnit.additional_teardown_methodsdotnet_diagnostic.NUnit.additional_one_time_setup_methodsdotnet_diagnostic.NUnit.additional_one_time_teardown_methods
Each configuration accepts a list of method names, separated by commas, semicolons, or spaces. For example:
dotnet_diagnostic.NUnit.additional_setup_methods = CustomSetup, MyInitAs in recent releases, a major part of this work was contributed by @manfred-brands.
The release contains contributions from the following users (in alphabetical order):
Issues Resolved
Features and Enhancements
- #921 NUnit1032 - disposals in overridden methods not detected
- #919 NUnit1032/NUnit3002 - local functions not analyzed
- #918 NUnit2045 - false positive for inline usings
- #911 NUnit3002 doesn't recognize the using statement.
- #910 using declarations not recognized by NUnit2045
Bugs
- #922 NUnit1001 - false positive for arguments with generic parameters
- #914 Wrong position of NUnit1001 diagnostic for TestCase with four parameters or more
Tooling, Process, and Documentation
NUnit Analyzers 4.10 - August 9, 2025
NUnit Analyzers 4.10 - August 9, 2025
This release of the NUnit Analyzers contains some minor improvements to NUnit2050, NUnit2056, and NUnit2007 as well
as some improvements to existing tests. Once again, @manfred-brands was responsible for the majority of the work.
The release contains contributions from the following users (in alphabetical order):
Issues Resolved
Bugs
- #901 False positive on NUnit2050
- #899 NUnit2056 analyzer's code fix removes comments and empty lines above it.
- #896 NUnit2007 shouldn't trigger for generic types e.g. typeof(T)
Tooling, Process, and Documentation
NUnit Analyzers 4.9.2 - June 17, 2025
NUnit Analyzers 4.9.2 - June 17, 2025
This release of the NUnit Analyzers extends the NUnit3001 nullability suppressor
to also work in the context of Assert.EnterMultipleScope and other using statements.
The release contains contributions from the following users (in alphabetical order):
Issues Resolved
Features and Enhancements
- #892 Assert.EnterMultipleScope not detecting nullability properly
NUnit Analyzers 4.9.1 - June 12, 2025
NUnit Analyzers 4.9.1 - June 12, 2025
This release of the NUnit Analyzers fixes a problem with the code-fix for translating
Assert.Multiple/Assert.MultipleAsync into the new Assert.EnterMultipleScope format
when the test method already is asynchronous and have a return type different from Task.
The release contains contributions from the following users (in alphabetical order):
Issues Resolved
Bugs
- #888 Assert.MultipleAsync -> EnterMultipleScope autofix produce invalid code
NUnit Analyzers 4.9 - June 11, 2025
NUnit Analyzers 4.9 - June 11, 2025
This release of the NUnit Analyzers adds several new analyzers. For the RangeAttribute,
the analyzers now warn about potential issues at runtime.
It also introduces an analyzer and code fix for translating
Assert.Multiple/Assert.MultipleAsync into the new Assert.EnterMultipleScope format, as well
as for converting is T checks into Is.InstanceOf<T>() constraints.
For NUnit2021, the analyzer now respects UsingPropertiesComparer, including enhancements
that will be available in NUnit 4.4.
Finally, this release includes improvements to NUnit2007, NUnit2045, and NUnit4002.
See the list of resolved issues below for more details.
The release contains contributions from the following users (in alphabetical order):
Issues Resolved
Features and Enhancements
- #880 NUnit2007 could flag typeof() as a constant first parameter
- #866 When Assert.Multiple is found, should suggest to convert to Assert.EnterMultipleScope
- #865 NUnit 2045 suggest Assert.Multiple, but should suggest Assert.EnterMultipleScope
- #857 NUnit2021 Should not raise for UsingPropertiesComparer
- #765 Add Rule for converting is T into Is.InstanceOf()
- #89 Test the correct usage of the Range attribute
Bugs
- #879
NUnit4002shouldn't trigger forTvsnullable<T>struct types
Tooling, Process, and Documentation
- #868 chore: bump version
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