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

FAA0001 false positive on expressions containing Count() or Length #383

Closed
davidnmbond opened this issue Sep 28, 2024 · 0 comments · Fixed by #384
Closed

FAA0001 false positive on expressions containing Count() or Length #383

davidnmbond opened this issue Sep 28, 2024 · 0 comments · Fixed by #384
Labels

Comments

@davidnmbond
Copy link

davidnmbond commented Sep 28, 2024

Description

FAA0001 should not suggest "Use .Should().HaveCount()" on non-simplistic expressions

Complete minimal example reproducing the issue

		// Arrange
		int[] x = [1, 2, 3];
		int[] y = [4, 5, 6];
		var both = x.Concat(y).ToArray();

		// Assert
		(x.Length + y.Length).Should().Be(both.Length);

Expected behavior:

No suggestion

Actual behavior:

FAA0001 Use .Should().HaveCount()

Versions

  • Fluent Assertions Analyzers 0.33.0
  • .NET runtime and version .NET 8.0

Additional Information

None

@davidnmbond davidnmbond changed the title FAA0001 false positive on expressions containing Count() FAA0001 false positive on expressions containing Count() or Length Sep 28, 2024
@Meir017 Meir017 added the bug label Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants