Skip to content

Releases: nunit/nunit.analyzers

NUnit Analyzers 3.6.1 (and 2.6.1) - March 10, 2023

10 Mar 22:22
e3a226e
Compare
Choose a tag to compare

NUnit Analyzers 3.6.1 (and 2.6.1) - March 10, 2023

This release of the NUnit Analyzers contain a single bug fix and some updates of dependencies.
The bug fix removes a false from NUnit1030 - "The type of parameter provided by the TestCaseSource
does not match the type of the parameter in the Test method" - when using TestCaseParameters.

The release contains contributions from the following users (in alphabetical order):

Issues Resolved

Bugs

  • #523 False positive for NUnit1030 with TestCaseParameters bug

Tooling, Process, and Documentation

  • #528 chore(deps): Bump NUnit3TestAdapter from 4.4.0 to 4.4.2
  • #527 chore(deps): Bump NUnit3TestAdapter from 4.3.1 to 4.4.0
  • #522 chore(deps): Bump Microsoft.NET.Test.Sdk from 17.4.1 to 17.5.0

NUnit Analyzers 3.6 (and 2.6)

21 Feb 20:47
ec7c360
Compare
Choose a tag to compare

NUnit Analyzers 3.6 (and 2.6) - February 21, 2023

This release of the NUnit Analyzers improves on the analysis of nullable reference types - in particular
in case of null coalescing operator and tuple deconstruction assignments.

The release also adds two new diagnostics for the TestCaseSource attribute. The diagnostics examines the test data returned
from the TestCaseSource:

  • NUnit1029 - The number of parameters provided by the TestCaseSource does not match the number of parameters in the Test method
  • NUnit1030 - The type of parameter provided by the TestCaseSource does not match the type of the parameter in the Test method

In addition, the release also contains some bug fixes to existing analyzers, and we have added a GitHub Actions workflow
and status badge.

The release contains contributions from the following users (in alphabetical order):

The majority of the code contributions were provided by @manfred-brands.

Issues Resolved

Features and Enhancements

  • #503 DiagnosticsSuppressor doesn't suppress null coalescing operator
  • #499 DiagnosticSuppressor doesn't detect tuple deconstruction assignments
  • #442 Analyzer for TestCaseSource does not check Test method parameters

Bugs

  • #509 Giving TestCaseAttribute an explicit decimal for a parameter that is a decimal gives a Nunit 1001 error
  • #496 NUnit2045 code-fix does not correctly lift asynchronous assertions into Assert.Multiple
  • #475 Code Fix for NUnit2010 on Ref Structs Creates CS1503

Tooling, Process, and Documentation

  • #519 chore: Update year to 2023
  • #518 fix: Correct MSDN link on new pages
  • #516 Replace link to ruleset docs
  • #507 chore: Add Github Action build status badge
  • #500 Fix path to global.json
  • #497 chore(deps): Bump Microsoft.NET.Test.Sdk from 17.3.2 to 17.4.1
  • #489 Add note about works with unity3d
  • #487 chore(deps): Bump NUnit3TestAdapter from 4.2.1 to 4.3.0
  • #486 chore: Bump version to 3.6 (2.6)
  • #476 [add] GitHub Actions workflow for running test

NUnit Analyzers 3.5 (and 2.5)

23 Oct 20:39
cb372af
Compare
Choose a tag to compare

NUnit Analyzers 3.5 (and 2.5) - October 23, 2022

This release of the NUnit Analyzers only fixes the casing in a file name in the nuget file as nuget upload validation failed.

The release contains contributions from the following users (in alphabetical order):

Issues Resolved

Tooling, Process, and Documentation

  • #484 chore: Bump version to 3.5 (2.5)
  • #483 chore: NuGet.org validation is case sensitive

NUnit Analyzers 3.4 (and 2.4)

23 Oct 19:38
479272e
Compare
Choose a tag to compare

NUnit Analyzers 3.4 (and 2.4) - October 23, 2022

This release of the NUnit Analyzers improves on false positives in the existing analyzers for:

  • NUnit2021 - "Incompatible types for EqualTo constraint"
  • NUnit2046 - "Use CollectionConstraint for better assertion messages in case of failure"

The release also improves on NUnit3002 - "Field/Property is initialized in SetUp or OneTimeSetUp method" to
also consider initialization in overridden SetUp methods, and adds support for classic StringAssert constraints
in NUnit2007 - "The actual value should not be a constant" - analyzer and code fix.

In addition, the release also contains some bug fixes to existing analyzers.
Moreover, several dependencies have been bumped in this release and the build process has been improved.

The release contains contributions from the following users (in alphabetical order):

Issues Resolved

Features and Enhancements

  • #465 False positive for NUnit2021 with Throws/EqualTo contraint
  • #459 False positives for NUnit2046 on non-array-like types
  • #453 Support classic StringAssert in ConstActualValueUsage analyzer and code fix
  • #448 Analyzer doesn't detect non-nullable field set in overridden SetUp method

Bugs

  • #440 Analyzer conversion for class with Count property can be incorrect
  • #436 Using Has.Count in Assert.Multiple re-raises nullable reference warning
  • #420 NUnit2045 raises IndexOutOfRangeException on CodeAnalysis

Tooling, Process, and Documentation

  • #479 chore(deps): Bump Microsoft.NET.Test.Sdk from 17.3.1 to 17.3.2 in /src
  • #470 chore(deps): Bump Microsoft.NET.Test.Sdk from 17.2.0 to 17.3.1 in /src
  • #467 Build Issues
  • #463 chore(deps): Bump Nullable from 1.3.0 to 1.3.1 in /src
  • #461 chore(deps): Bump Gu.Roslyn.Asserts from 4.2.1 to 4.3.0 in /src
  • #456 chore(deps): Bump Microsoft.NET.Test.Sdk from 17.1.0 to 17.2.0 in /src
  • #455 chore(deps): Bump Gu.Roslyn.Asserts from 4.2.0 to 4.2.1 in /src
  • #454 Ignore Rider IDE files
  • #452 chore(deps): Bump StyleCop.Analyzers.Unstable from 1.2.0.406 to 1.2.0.435 in /src
  • #451 Mark build.sh as executable
  • #446 Move to latest Gu.Roslyn.Assert nuget packages
  • #441 chore(deps): Bump NUnit from 3.13.2 to 3.13.3 in /src
  • #440 chore(deps): Bump Microsoft.NET.Test.Sdk from 17.0.0 to 17.1.0 in /src
  • #437 chore(deps): Bump NUnit3TestAdapter from 4.1.0 to 4.2.1 in /src
  • #428 Move to use cake as a dotnet tool
  • #419 chore: Bump version to 3.4 (2.4)
  • #418 Add README.md to nuget file
  • #272 Enforce coding standard more strictly

NUnit Analyzers 3.3 (and 2.3)

08 Jan 22:12
e4d662c
Compare
Choose a tag to compare

NUnit Analyzers 3.3 (and 2.3) - January 8, 2022

This release of the NUnit Analyzers adds a DiagnosticSuppressor for Nullable<T>, an analyzer and a code fix
for rewriting independent asserts into Assert.Multiple, and an analyzer and a code fix for replacing calls to
.Length or .Count() in the actual expression with inbuilt assertion functionality. The release also contains
some bug fixes to existing analyzers.

Moreover, several dependencies have been bumped in this release.

The release contains contributions from the following users (in alphabetical order):

Issues Resolved

Features and Enhancements

  • #414 Add DiagnosticSuppressor for Nullable<T>
  • #389 Idea: Suggest Assert.Multiple in tests where Assert statements are called back to back
  • #330 Analyzer to warn against calling .Length or .Count() in the actual expression

Bugs

  • #410 NUnit2044 false-positive on explicit delegate type
  • #407 NUnit2022 false-positive on generic Dictionary type bug

Tooling, Process, and Documentation

  • #401 chore(deps): Bump NUnit3TestAdapter from 4.0.0 to 4.1.0 in /src
  • #398 Ensure all NunitFrameworkConstants are tested
  • #397 Allow using C# 9
  • #396 chore(deps): Bump Microsoft.NET.Test.Sdk from 16.11.0 to 17.0.0 in /src
  • #394 chore(deps): Bump Microsoft.CodeAnalysis.Analyzers from 3.3.2 to 3.3.3 in /src
  • #392 Replace netcoreapp2.1 for test with netcoreapp3.1
  • #388 chore: Bump version to 3.3 (2.3)
  • #381 Update Code of Conduct

NUnit Analyzers 3.2 (and 2.2)

28 Aug 19:56
0b27a86
Compare
Choose a tag to compare

NUnit Analyzers 3.2 (and 2.2) - August 28, 2021

This release of the NUnit Analyzers contains an improvement to the suppression of
'Non-nullable field must contain a non-null value when exiting constructor (CS8618)'
when the field/property is initialized by a method called from a SetUp/OneTimeSetUp method.

Moreover, several dependencies have been bumped in this release.

The release contains contributions from the following users (in alphabetical order):

Issues Resolved

Features and Enhancements

  • #385 Supress (even more) 'Non-nullable field must contain a non-null value when exiting constructor (CS8618)'

Tooling, Process, and Documentation

  • #384 chore(deps): Bump Microsoft.NET.Test.Sdk from 16.10.0 to 16.11.0 in /src
  • #379 chore(deps): Bump StyleCop.Analyzers.Unstable from 1.2.0.333 to 1.2.0.354 in /src
  • #376 chore(deps): Bump NUnit3TestAdapter from 3.17.0 to 4.0.0 in /src
  • #375 chore(deps): Bump Microsoft.NET.Test.Sdk from 16.9.4 to 16.10.0 in /src
  • #374 chore(deps): Bump NUnit from 3.13.1 to 3.13.2 in /src
  • #373 chore: Bump version to 3.2 (2.2)
  • #367 chore(deps): Bump Microsoft.CodeAnalysis.CSharp.CodeStyle from 3.8.0 to 3.9.0 in /src

NUnit Analyzers 3.1 (and 2.1)

04 Apr 19:43
3700ba0
Compare
Choose a tag to compare

NUnit Analyzers 3.1 (and 2.1) - April 4, 2021

This release of the NUnit Analyzers primarily contains improvements to the analysis of nullable reference types
to handle even more cases.

The release also contain improvements when passing a non-lambda to Throws assertions and when non-delegate actual
value is used with DelayedConstraint.

The release contains contributions from the following users (in alphabetical order):

Issues Resolved

Features and Enhancements

  • #368 Extend NonNullableFieldIsUninitialized to also work for properties
  • #363 NonNullableFieldIsUninitializedSuppressor fails when there is a constructor
  • #360 NonNullableFieldIsUnintializedSuppressor doesn't recognize ExpressionBody
  • #357 Warns about passing a non-lambda to Throws assertions
  • #353 Replace deprecated FxCopAnalyzer with NetAnalyzer
  • #345 Nullable warnings should be suppressed for Assert.Catch()
  • #342 Nullable suppression for Assert.Throws does not work in presence of a Assert.Multiple block
  • #149 Warning when non-delegate actual value is used with DelayedConstraint

Tooling, Process, and Documentation

  • #371 chore(deps): Bump Microsoft.NET.Test.Sdk from 16.9.1 to 16.9.4 in /src
  • #370 chore(deps): Bump StyleCop.Analyzers.Unstable from 1.2.0.321 to 1.2.0.333 in /src
  • #365 chore(deps): Bump Microsoft.NET.Test.Sdk from 16.8.3 to 16.9.1 in /src
  • #358 Bump Gu.Roslyn.Asserts from 3.3.1 to 3.3.2 in /src
  • #356 chore: Bump cake bootstrap to latest to make it compatible with Cake 1.0
  • #352 Bump NUnit3TestAdapter from 3.15.1 to 3.17.0 in /src
  • #351 Bump NUnit from 3.13 to 3.13.1 in /src
  • #350 Bump StyleCop.Analyzers.Unstable from 1.2.0.261 to 1.2.0.321 in /src
  • #349 Bump Microsoft.NET.Test.Sdk from 16.8.0 to 16.8.3 in /src
  • #348 Bump Nullable from 1.2.1 to 1.3.0 in /src
  • #347 Update dependabot.yml
  • #346 Create dependabot.yml
  • #341 chore: Bump version to 3.1 (2.1)

NUnit Analyzers 3.0 (and 2.0)

18 Jan 20:14
c4456ca
Compare
Choose a tag to compare

NUnit Analyzers 3.0 (and 2.0) - January 18, 2021

This release of the NUnit Analyzers adds the possibility to suppress compiler errors based on context.
Initially, we support the suppression of errors arising from nullable reference types (many thanks to
Manfred Brands for this major contribution). This functionality depends on a newer version of Roslyn
which is not supported in Visual Studio 2017 (only in Visual Studio 2019).

So we have decided to release two versions of the analyzers: versions starting with 2.x can be used in Visual
Studio 2017 and versions starting with 3.x can be used in Visual Studio 2019 (the major version number matches
the major version number of Roslyn). Most features will be available in both the 2.x versions and the 3.x versions,
unless they require Roslyn functionality that is only available in the 3.x versions.

The release also contains some bugfixes to existing diagnostics.

The release contains contributions from the following users (in alphabetical order):

Issues Resolved

Features and Enhancements

  • #157 Suppress nullability warnings after Is.Not.Null constraint
  • #329 Analyzer to warn against comparison operators in actual expression
  • #333 Add nullable suppression for Assert.Throws

Bugs

  • #320 Incorrect NUnit1011 when TestCaseSource references a base class member
  • #322 NUnit2021 false positive for IEquatable
  • #332 NUnit2026 shouldn't fire when CustomEqualityComparer is used

Tooling, Process, and Documentation

  • #319 chore: Bump version to 0.7
  • #323 Update to latest GuOrg.Roslyn.Asserts
  • #326 fix: Correct missing change AnalyzerAssert => RoslynAssert
  • #328 fix(docs): Fix linting issue
  • #335 Move Constant code closer to actual rule
  • #336 Create a .NETStandard2.0 release

NUnit Analyzers 0.6

24 Nov 22:02
004ff87
Compare
Choose a tag to compare

NUnit Analyzers 0.6 - November 24, 2020

This release of the NUnit Analyzers corrects several false positives from the analyzers.

We have also added a dependency on the Microsoft.CodeAnalysis.Analyzers package to help
us follow Roslyn best practices. The analyzer project is now multi-targeting to allow
us to better use Nullable Reference Types in the codebase.

The release contains contributions from the following users (in alphabetical order):

Issues Resolved

Bugs

  • #300 NUnit2041 false positives
  • #302 False positive NUnit1004 for test functions that receive array parameters
  • #304 Unable to compile test project when classlib with TestCaseSources is referenced
  • #306 NUnit2022 rule has false positive on hierarchies when using And
  • #308 NUnit1028 false positives
  • #311 NUnit1028 vs. IDisposable
  • #312 NUNIT1003 false positive

Tooling, Process, and Documentation

  • #299 chore: Bump version to 0.6
  • #301 fix(documentation): Linting and spelling mistakes
  • #314 Add Microsoft.CodeAnalysis.Analyzers

NUnit Analyzers 0.5

30 Sep 20:02
6d84d58
Compare
Choose a tag to compare

NUnit Analyzers 0.5 - September 30, 2020

This release of the NUnit Analyzers adds three new diagnostics. One for ensuring that only test methods are public in a test class, one disallowing the SameAs constraint on non-reference types, and one enforcing that only compatible types are used in a comparison constraint. We have also extended several of the existing diagnostics so that they apply to more cases.

Furthermore, we have significantly improved the performance of many of the existing diagnostics - inspired by work done on the xunit.analyzers.

Finally, the documentation has been improved with additional information in the index and information about configuration of the diagnostics using .editorconfig, and we have added StyleCop and FxCop analyzers to enforce the coding standard.

The release contains contributions from the following users (in alphabetical order):

Issues Resolved

Features and Enhancements

  • #147 Analyzer for non-test methods to be non-public
  • #197 Handle custom type converters
  • #270 Get inspiration from the performance improvements made for the xunit.analyzers
  • #273 NUnit2003: Add code fix with less explicit overload for testing if something is true
  • #276 SameAs should warn if used with value types
  • #279 Augment SameAsIncompatibleTypes and EqualToIncompatibleTypes to apply for more cases
  • #293 Make diagnostic's severity consistent

Bugs

  • #274 NUnit2021 fires on delegates
  • #290 Not treating Func and Action properly for type compatibility.
  • #280 Consider overload resolution when transforming to comparison constraints

Tooling, Process, and Documentation

  • #20 Add StyleCop.Analyzers & fix warnings
  • #191 Make it possible to run tests both in .NET framework and .NET Core
  • #210 index.md in the documentation should also contain information about Severity
  • #267 chore: Bump version to 0.5
  • #268 Correct typo in NUnit1027 documentation
  • #271 Documentation: Add section for each analyzer on how to configure severity using an .editorconfig file
  • #288 Add FxCop Roslyn analyzer
  • #296 fix: Make code compile in both targets