I asked the following question on StackOverflow a few days ago, because I wasn't sure if I had missed something regarding nullable comparison, or if there is an actual bug in FluentAssertions: http://stackoverflow.com/questions/10752307/is-this-a-bug-when-comparing-a-nullable-type-with-its-underlying-type-using-flue
Since there hasn't been an answer to the question yet, I can only assume that it is a bug. In short, the issue seems to appear when comparing a nullable against its base type (float in my case):
float expected = 3.14f;
float notExpected = 1.0f;
float? actual = 3.14f;
actual.Should().BeApproximately(expected, 0.1f); // passes correctly
actual.Should().BeApproximately(notExpected, 0.1f); // passes, would expect it to fail
See the question on StackOverflow for more details.
Comments: ** Comment from web user: BeatW **
Since there hasn't been an answer to the question yet, I can only assume that it is a bug. In short, the issue seems to appear when comparing a nullable against its base type (float in my case):
float expected = 3.14f;
float notExpected = 1.0f;
float? actual = 3.14f;
actual.Should().BeApproximately(expected, 0.1f); // passes correctly
actual.Should().BeApproximately(notExpected, 0.1f); // passes, would expect it to fail
See the question on StackOverflow for more details.
Comments: ** Comment from web user: BeatW **
see also discussion at http://fluentassertions.codeplex.com/discussions/355272
okey.. It wasn't a discussion yet...