fluentassertions.analyzers icon indicating copy to clipboard operation
fluentassertions.analyzers copied to clipboard

Allow disabling hint on specifically `Assert.NotNull`

Open Alxandr opened this issue 1 year ago • 0 comments

Description

Assert.NotNull from xunit has annotations that .NET. This method is thus not just to convert in the same vein as most other xunit assertions.

Complete minimal example reproducing the issue

var subject = GetThingOrNull();
Assert.NotNull(subject);
subject.Property.Should().HaveCount(5);

This is fine, but if I change the Assert.NotNull per fluent-assertions suggestion to subject.Should().NotBeNull(), I get a compiler-warning on the property access.

Alxandr avatar Jun 19 '24 13:06 Alxandr