Skip to content

BeEquivalentTo on double collections #1010

@Brondahl

Description

@Brondahl
new List<double> { 0.02 }.Should().BeEquivalentTo(0   );
new List<double> { 0    }.Should().BeEquivalentTo(0.02);
new List<double> { 0.02 }.Should().BeEquivalentTo(0.00);
new List<double> { 0.00 }.Should().BeEquivalentTo(0.02);

The first line passes, all the others fail.

I can see an argument for .BeEquivalentTo() isn't, in general, meaningful on collections of doubles/floats, in the same way that .Be() or .BeEqualTo() isn't.
But it should at least be self-consistent, shouldn't it?

Versions

FA v5.6.0
.Net Fmwk 4.6.1
C# 7.3

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions