Skip to content

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

Closed
@davidnmbond

Description

@davidnmbond

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions