Closed
Description
After updating to v5 when using FluentAssertions's .BeEquiavalentTo() on classes having UnitNet's types as members, we get false negatives, like:
Expected property actual.Mileage to be 0 m, but found 0 km
This worked properly in v4.
As far as I can understand, the reason for this is that .BeEquiavalentTo() uses .Equals() method which is implemented as:
public bool Equals(Length other)
{
return new { Value, Unit }.Equals(new { other.Value, other.Unit });
}
IMO, this is incorrect behavior. 0 km == 0m, 1km == 1000 m etc. Is not that a valid assumption when writing unit tests?