Incorrect possible system.nullreferenceexception when using NUnit's Assert.That syntax

If you check for null using the old assert syntax, ReSharper is happy:

Assert.IsNotNull(someObject);

Assert.True(someObject.SomeBool);

However, if you use fluid assert syntax, you get a "Possible 'System.NullReferenceException'" in the second assert:

Assert.That(someObject, Is.Not.Null);

Assert.That(someObject.SomeBool);

Regards,

Morten G.

2 comments

You may want to vote on existing issue: http://youtrack.jetbrains.net/issue/RSRP-185247 "ReSharper Doesn't Recognise NUnit's Constraint Syntax"

0

Aah, great! I tried searching for the issue before posting a new, but was unable to find something.
I have now given my vote.

Regards,
Morten G.

0

Please sign in to leave a comment.