Skip to content

NUnit.Analyzers 4.3.0 missed an Assert.Positive that caused a build error after upgrading to latest NUnit 4.2.2 #789

@MCPtz

Description

@MCPtz

NUnit.Analyzers 4.3.0 missed an Assert.Positive that caused a build error after upgrading to NUnit 4.2.2, from NUnit 3.13.3

That is there was no build error or warning when on NUnit 3.13.3 and building with NUnit.Analyzers 4.3.0.

Or if there was a warning, I missed it because I had tens of thousands of changes to make.

I suggest this becomes a build error for NUnit.Analyzers.

In this case, it was a double:

var elapsedTime1 = results.DurationInSeconds;//NOTE: elapsedTime1 is a double
Assert.Positive(elapsedTime1);

Which I changed to:

Assert.That(elapsedTime1, Is.GreaterThanOrEqualTo(0));

I just grabbed the excerpt from our test to make this a quick bug report.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions