IComparable is for sort order not if two objects are equals#25
IComparable is for sort order not if two objects are equals#25liborweigl wants to merge 1 commit intomachine:masterfrom
Conversation
|
I don't think this is right, as we still want to retain the ability to calculate equality using I have no idea why you would have different definitions of 'equality' for Also this needs unit tests. |
|
@robertcoltheart In the following issue I argued why prefering IComparable over IEquatable is not a good idea (In short: The IComparable contract is not about (value) equality). |
|
We're in the same boat as FluentAssertions, which is that we would break any existing uses of this package. I stand by the statement above, which is that it's preferable to check for For reference, since we're talking about how different packages deal with this, xunit also checks |
|
Hi All, Yes, I fully agree with @ulrichb over I can add tests coverage if we decide go head with this change. Thanks Libor |
|
I'm happy to make the change, but, similar to the way xunit does it, I'd want to check |
|
Yes, please swap the order. |
Hi All,
I think remove
new ComparableComparer<T>()from Comparers strategy should fix this bug.machine/machine.specifications#372
Thanks
Libor