-
Notifications
You must be signed in to change notification settings - Fork 731
Changed Be/NotBe on IComparable to use Object.Equals and added BeRankedEquallyTo #1177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changed Be/NotBe on IComparable to use Object.Equals and added BeRankedEquallyTo #1177
Conversation
|
I agree on the change and think the potential runtime breakage sounds reasonable. From
Can we offer an alternative or guidance for users who still want to test that two items are equal using their subject.Should().BeLessOrEqualTo(expected)
.And.BeGreaterOrEqualTo(expected);
subject.Should().BeInRange(expected, expected);Explicit test but inferior failure message. subject.CompareTo(expected).Should().Be(0); |
|
How about naming it |
Love that one. Probably should be |
|
@rubenrorije are you planning to add that |
…als) and do not check that CompareTo returns 0 for equal objects
|
Sorry, made the same git mistakes again. I am obviously still a noob on the git part. I will try to fix this. |
|
Could you give me some pointers to resolve the git issues here? I assume that the rebase I did resulted in the commits 9050e37 and c477f8b to be included. But I am a bit lost how to resolve this. My solution would be to create a new branch and cherrypick commits, but that seems like an extreme solution that should not be necessary. |
|
@rubenrorije It looks like you pulled In git commits are identified by a hash value computed on the difference between the commit and its parent commit. Before rebasing both your local branch and the remote branch on github looks like: After rebasing your local branch the picture is now remote: As So if you pull master instead of force pushing the local picture becomes: If you rebase again on The terminal opens some editor (for me it's Vim) |
d9621f4 to
1e114f1
Compare
|
Thanks for the extensive explanation. That made things much clearer. I was able to fix the issues now. I did not want to screw everything up again by rebasing again. When the pull request is not accepted directly it must be done again anyway. |
|
I haven't fallen in love with
|
|
I agree discussing this a bit more might be useful. I do not have a strong preference.
If I would see the options Slightly related and maybe against the whole idea of the project, but I think it would be nice to have one (additional?) function to check all comparisons: |
|
I could live with |
|
What about |
|
I'm fine with |
|
I do not have any preference, so I renamed the methods. |
|
What's stopping us from merging this one? |
|
Now the unit test is failing on the changed message. |
Added missing BeRankedEquallyTo docs for #1177
A new pull request for #172 in which all commits have been cleaned up. I struggled with getting Git to behave the way I wanted, but I think this should be it.
Just to reiterate, this might be a breaking change when released since it does not check CompareTo == 0 anymore. This might be something people depend upon.