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

Created 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.

Viewing all articles
Browse latest Browse all 1402

Trending Articles



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