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

Closed Unassigned: Print x.0 when x is is a double/float representing a whole number [12493]

$
0
0
I certainly will understand if this does not get picked up since there are a lot of other similar situations that would not be as easy to fix, but it would be a nice-to-have so I thought I would throw it out.

```
var a = new {A = (object) 5};
var b = new {A = (object) 5.0};

a.Should().Be(b);
```

Fails with
> Expected object to be { A = 5 }, but found { A = 5 }.

It would be nice if it failed with
> Expected object to be { A = 5.0 }, but found { A = 5 }.

because then one would not need to go into the debugger to figure out what is different.

Of course this is a very simple example, would be more useful for with things with larger printouts such as more complex objects, or CollectionAssertions.BeEquivalentTo on collections of complex objects.

Comments: Continued on GitHub https://github.com/dennisdoomen/fluentassertions/issues/4

Viewing all articles
Browse latest Browse all 1402

Trending Articles



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