Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False positive for WithinUsageAnalyzer #580

Closed
manfred-brands opened this issue Aug 31, 2023 · 0 comments · Fixed by #581
Closed

False positive for WithinUsageAnalyzer #580

manfred-brands opened this issue Aug 31, 2023 · 0 comments · Fixed by #581
Assignees

Comments

@manfred-brands
Copy link
Member

We get false positives for when nullable numeric types are used:

[TestCase(null, null)]
[TestCase(1, 1)]
[TestCase(1.01, 1)]
public void Nullables(double? actual, double? expected)
{
    Assert.That(actual, Is.EqualTo(expected).Within(0.1));
}

If the values are not null, the NumericsComparer will use the tolerance.

Allow Nullable<T> where T itself is allowed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants