Quantcast
Channel: Fluent Assertions
Viewing all articles
Browse latest Browse all 1402

Commented Issue: False positive with Should().BeApproximatively and float.NaN value [12479]

$
0
0
Hi,

The method BeApproximatively does not fail if the actual value is float.NaN.
Here is the test :
```
[Fact]
public void Test_ShouldFail()
{
var actual = float.NaN;
var expected = 5f;
actual.Should().BeApproximately(expected, 0.01f);
}
```

Note that the test fails as expected with a double.
Comments: Fixed in commit https://fluentassertions.codeplex.com/SourceControl/changeset/98915d94b473cfb9215080e1ae0fd7bc6b0bb65e

Viewing all articles
Browse latest Browse all 1402

Trending Articles



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