Skip to content

False warning of FAA0001 when using 2D array #309

Closed
@scott-moxham

Description

@scott-moxham

Description

When testing the length of a 2D array is 0, the analyzer reports that I should use .HaveCount(0) but this isn't available for 2D arrays.

Complete minimal example reproducing the issue

// Arrange
var array = new string[0, 0];

// Assert
array.Length.Should().Be(0);

Expected behavior:

Shouldn't be any issues flagged

Actual behavior:

I get an FAA0001 issue flagged with the message "Use .Should().HaveCount()"

Versions

  • Which version of Fluent Assertions Analyzers are you using? 0.30.0
  • Which .NET runtime and version are you targeting? .Net 8

Additional Information

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