Skip to content

Using null conditional in assertion should be reported as code smell #21

Closed
@krajek

Description

@krajek

In main FA repository, there was an issue reported fluentassertions/fluentassertions#569.

To keep it short, the user used ?. operator:

int? val = null;
val?.Should().Be(400);

instead of regular

val.Should().Be(400);

Do you think it is possible to detect such scenario and suggest code fix?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions