Skip to content

CollectionShouldNotContainProperty is too aggresive #64

@jnyrup

Description

@jnyrup

Description

The CollectionShouldNotContainProperty is triggered when the assertions already seems idiomatic.

An example is when the expression inside OnlyContain contains no negations.

var list = new[] { "" };

list.Should().OnlyContain(e => e.Contains(""));

Expected behavior:

The analyzer should not be triggered, as the assertion is already idiomatic.

Actual behavior:

The analyzer is triggered.

Versions

Fluent Assertions Analyzers 0.11.2
.NET Framework 4.6.1

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