Quantcast
Channel: YouTrackReSharper (RSRP) - Bug and Issue Tracker
Viewing all articles
Browse latest Browse all 106942

RSRP-275218: Warning for 'Possible System.InvalidOperationException' in unit test assert

$
0
0
Reporter Alex Berezoutsky (fergard) Alex Berezoutsky (fergard)
Created Aug 31, 2011 6:19:58 PM
Updated Jan 24, 2012 10:11:54 PM
Resolved Jan 24, 2012 6:29:06 PM
Priority Major
Type Bug
Fix versions Next
State Fixed
Assignee Evgeny Pasynkov (pasynkov)
Subsystem No subsystem
Affected versions 6.0
Fixed in build 6.5.1.3309
In Visual Studio 2010 with Resharper 6.0 I have a unit test in which I'm asserting the following:

Assert.IsTrue(myObject.myNullableDate.HasValue);
Assert.AreEqual(myExpectedDate, myObject.myNullableDate.Value);


Resharper insists in warning about the 'Possible System.InvalidOperationException' under the 'myObject.myNullableDate.Value' statement and suggests checking if 'myNullableDate' is not null, which I have already in the previous statement. I have even tried to change the previous statement to:

Assert.IsNotNull(myObject.myNullableDate);


to no avail.

Viewing all articles
Browse latest Browse all 106942

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>