Skip to content

Releases: nunit/nunit.analyzers

NUnit Analyzers 0.4

25 Jul 22:03
3666faf
Compare
Choose a tag to compare

NUnit Analyzers 0.4 - July 25, 2020

This release of the NUnit Analyzers adds 13 new diagnostics and codefixes for asserts in the classical model -
e.g. Assert.Greater, Assert.IsNotEmpty, Assert.IsNotInstanceOf etc. We have also improved the handling of
asserts against constants and variables of type Task.

In addition, we now properly handle ValueSourceAttribute and test methods decorated with both a
TestAttribute and a TestCaseSourceAttribute/TestCaseAttribute. We have also added a diagnostic and codefix
to ensure that test methods are public.

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

Issues Resolved

Structure, TestCase, and TestCaseSource

  • #93 Analyzer to ensure that the "target" of ValueSourceAttribute exists and is static
  • #212 Nunit1007 - ignore [Test] attribute when [TestCaseSource] is present
  • #215 Expected a warning when no arguments are specified for a parameterized test method
  • #245 Ensure that Test Methods are Public

Assertions

  • #233 Code fix switching Has.Length to Has.Count for NUnit2022
  • #256 NUnit2007 should not fire if both sides are constant
  • #257 Need more rules for Classic Model with codefix to transform to Constraint model
  • #258 NUnit2023 fires on variables of type Task

Process, documentation, and tooling

  • #244 chore: Bump version to 0.4
  • #253 Correct markdown linting errors in the analyzers documentation
  • #261 Update .editorconfig to match overall code-style used

NUnit Analyzers 0.3

20 May 22:42
435d65a
Compare
Choose a tag to compare

NUnit Analyzers 0.3 - May 20, 2020

This release of the NUnit Analyzers improves the documentation of all the diagnostics.
Furthermore, we have added the following analyzers and diagnostics:

  • an analyzer for proper usage of string constraints,
  • an analyzer for proper usage of ContainsConstraint,
  • an analyzer for proper usage of Does.Contain and Contains.Item,
  • six new diagnostics to handle the full scope of the TestCaseSource attribute.

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

Issues Resolved

Structure, TestCase, and TestCaseSource

  • #204 Extend TestCaseSourceUsesStringAnalyzer to handle all constructors of TestCaseSourceAttribute
  • #209 NUnit1001 and NUnit1005 complains about string to integer conversion
  • #214 Add diagnostics and tests for all cases of TestCaseSourceUsesStringAnalyzer
  • #227 TestCaseSource: Fix codefix for nameof so that it also works when the source is in another class

Assertions

  • #219 Add warning when string analyzers are used against non-string actual argument
  • #221 Add warning when ContainsConstraint is used against incompatible argument type
  • #229 Fix EqualToIncompatibleTypesAnalyzer false positive
  • #230 False positive NUnit2020 for Has.None.SameAs
  • #235 Fix StringConstraintAnalyzer false positive for delegate/task
  • #240 Add SomeItemsIncompatibleTypesAnalyzer

Process, documentation, and tooling

  • #201 chore: Bump version to 0.3
  • #202 chore: Add nuget badge and update download section
  • #205 Document all the analyzers
  • #208 Analyzers List: Add icon for "enabled by default"
  • #216 refac: Replace Tuples with ValueTuples
  • #222 Use nullable reference types
  • #225 chore: Add missing documentation files to solution
  • #226 Nullable fixes
  • #228 Tests fixes
  • #234 Improve every text: titles, messages, and descriptions of the analyzers and code-fixes

NUnit Analyzers 0.2

16 Apr 18:00
709f009
Compare
Choose a tag to compare

NUnit Analyzers 0.2 - April 13, 2020

This is the initial release of the NUnit Analyzers. The release consists of analyzers
and code fixes for:

  • proper usage of the TestCaseAttribute,
  • proper usage of ParallelScopeAttribute,
  • translation of assertions written in the classic model into the constraint model,
  • proper usage of some of the most used assertions (Is.EqualTo, Is.SameAs, Has.Count,
    Has.Property(...), Is.Null).

The full list of analyzers can be found at https://github.com/nunit/nunit.analyzers/blob/master/documentation/index.md.

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

Issues Resolved

Structure and TestCase

  • #1 TestCase analyser doesn't handle nullables
  • #7 Feature request: Look for async void tests
  • #8 TestCaseUsageAnalyzer throws NullReferenceException for non-existent attribute
  • #11 NRE in AnalyzePositionalArgumentsAndParameters
  • #14 NRE in AttributeArgumentSyntaxExtensions.CanAssignTo
  • #28 NRE when writing an attribute before adding a reference to NUnit
  • #41 Only examine TestCaseAttribute if reference to NUnit exists
  • #42 Reorder statements for performance reasons
  • #48 Async test method must have non-generic Task return type when no result is expected
  • #49 Message: Async test method must have Task return type when a result is expected
  • #50 Remove false positive from ExpectedResult when used in connection with async tests
  • #54 Analyzer for TestCaseAttribute should also work for generic TestCases
  • #55 Analyzer for TestCaseAttribute should also work for nullable types
  • #56 Analyzer for TestCaseAttribute should work when passed 1 to 3 arguments
  • #57 Make conversions work in netcoreapp2.0
  • #64 Add an Analyzer to Verify ParallelScope Usage
  • #75 Add error if tests/testcases have a return value, but no ExpectedResult
  • #76 Add initial class for test method analyzer
  • #79 NUNIT_7 does not cater for Task and ValueTask
  • #80 Suggestion: Analyzer Should Fix TestCaseSource(string) usage to use nameof()
  • #86 Simplify TestCaseUsage
  • #92 Analyzer to ensure that the "target" of TestCaseSourceAttribute exists and is static
  • #106 Add fixer for the TestCaseSource(StringConstant) analyzer
  • #118 Async Tests display warning about missing Expected
  • #123 Generalise TestMethodUsageAnalyzer to support custom awaitables
  • #148 Analyzer update needed for string->datetime offset conversion in testcaseattribute
  • #150 Analyzers and refactorings to use string constraints instead of methods
  • #162 NUnit1001: False positive
  • #165 AD0001 Crash: TestCase contains int instead of enum
  • #169 NUnit1001 False Positive with params in the list
  • #186 False error when Uri is parameter and string is argument
  • #196 Avoid loading new assemblies into the VS process

Assertions

  • #12 NRE in ClassicModelAssertUsageAnalyzer.AnalyzeInvocation
  • #13 "Sequence contains no elements" in ClassicModelAssertUsageAnalyzer.AnalyzeInvocation
  • #39 Warning if actual type does not match expected type
  • #40 Warning if literal or const value is provided as actual value
  • #83 NUNIT_7 Throws Unexpectedly On Integer to Decimal Conversions
  • #90 Check that checks against null is done on reference types
  • #117 Code fix for ConstActualValueUsageAnalyzer
  • #124 Warning if IgnoreCase is used for non-string constraint argument
  • #128 Add analyzer to capture missing properties
  • #129 Warning if actual value is same as expected
  • #145 Make analyzers suggesting refactoring to the constraint model default disabled?
  • #146 Add analyzer and code fix for Is.EqualTo usage
  • #152 Fix CodeFix for logical not expression
  • #153 Constraint model suggestion for Assert.AreSame
  • #154 Warning when SameAs compares expressions of incompatible types
  • #158 Add collection contains analyzer and codefix
  • #160 Do not replace line breaks in code fixes
  • #163 Feature: Assert.IsNull / Assert.IsNotNull Classic to Fluent
  • #168 Add Analyzers for Assert.[Is][Not]Null(expr)
  • #174 Introduce ConstraintExpression
  • #175 EqualToIncompatibleTypesAnalyzer should not warn if constraint expression has conditional parts
  • #178 Fix EqualToIncompatibleTypesAnalyzer boxing false positive
  • #179 EqualToIncompatibleTypes should warn if two different enums compared
  • #184 Fix Property analyzer for inherited interface
  • #187 Fix EqualTo diagnostic when errors present

Process and tooling

  • #16 Make the extension work with VS 2017
  • #17 Add CI support for master and PRs
  • #19 New project format and netstandard for analyzer project
  • #21 Remove dependency on NUnit for analyzer project
  • #22 Add editorconfig
  • #23 Use get-only properties for FixableDiagnosticIds
  • #25 Add initial cake script
  • #27 Update README.md
  • #30 Refine cake configuration
  • #32 Update readme
  • #33 Add information to CONTRIBUTING.md
  • #36 Make Pack work
  • #37 Add myget feed to tooling
  • #38 Make all cs files conform to editorconfig
  • #43 Create nuget package on AppVeyor
  • #44 Set package version
  • #46 Add badge to MyGet Feed
  • #47 Examine concurrent execution af analyzers
  • #61 Update Download section
  • #63 Make Appveyor run tests before creating nuget package
  • #68 Add images to README.md
  • #70 Simplify test in this project
  • #71 Small cleanup
  • #72 Fixing repository url metadata
  • #74 Add Installation element
  • #84 Partition the analyzers into categories and create identifier ranges for each category
  • #85 Give all analyzers unique identifiers
  • #87 Simplify TestMethodUsageAnalyzerTests and TestCaseSourceUsesStringAnalyzerTests
  • #88 Upload test results to AppVeyor
  • #96 Document implemented analyzers and fixers
  • #98 Replace tuples with named tuples
  • #101 Rewrite tests of CodeFixes with Gu.Roslyn.Asserts
  • #102 Remove nunit.analyzers.integrationtests and nunit.analyzers.playground projects
  • #103 Transfer ClassicModelAssertUsage tests to Gu.Roslyn.Asserts
  • #104 Remove unused methods
  • #105 Move test data into code
  • #116 Fix licenseUrl element in nuspec, will be deprecated
  • #126 Update README and move content to CONTRIBUTING
  • #131 Bump versions of nunit, nunit-console, and NUnit3TestAdapter
  • #132 Update nunit.analyzers.csproj
  • #134 Constraint analyzers have a lot of repeating code
  • #135 Pre-release nuget packages should be created with unique assembly versions
  • #139 Tests checking documentation
  • #140 Add helplinks pointing to analyzer docs
  • #141 Improve documentation of analyzers and fixers
  • #144 feat: Add motivation and examples for classical assertions
  • #182 Remove warning from "Pack"
  • #183 fix: Make version numbers consistent
  • #185 chore: Bump version
  • #192 Add missing information to nuget package
  • #194 fix: Replace invalid tokens in suffix