fluentassertions / fluentassertions.analyzers

Analyzers based on the FluentAssertions best practices docs
https://www.fluentassertions.com/tips
MIT License
136 stars 21 forks source link

Wrong description for `.Should().Contain()` and `.Should().NotContain()` #301

Closed FantasyTeddy closed 7 months ago

FantasyTeddy commented 7 months ago

Description

The current descriptions for these two analysis rules is wrong:

Rule Actual Expected
FAA0001 Use .Should().NotBeEmpty() Use .Should().Contain()
FAA0001 Use .Should().BeEmpty() Use .Should().NotContain()

Complete minimal example reproducing the issue

// Act
var actual = new List<int> {0};

// Assert
actual
    .Where(x => x <= 0)
    .Should().NotBeEmpty();
// or
actual
    .Where(x => x > 0)
    .Should().BeEmpty();

Versions

Meir017 commented 7 months ago

@FantasyTeddy thanks for reporting this!