-
-
Notifications
You must be signed in to change notification settings - Fork 545
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
ShouldBeEquivalentTo flags two seemingly equivalent objects #973
Comments
@godrose At least copy the source of the failing test in here together with the failure message you're seeing. |
@jnyrup Thanks for the reply. The tests fail with the following messages: Using previous version (5.4.2) restores the green state of the tests. |
I don't have time to look deeper into this today, but I reduced the test case to this: object item = new object();
object[] array = new[] { item };
IList readOnlyList = ArrayList.ReadOnly(array);
// Works
readOnlyList[0].Should().BeEquivalentTo(array[0]);
// Fails
readOnlyList.Should().BeEquivalentTo(array); |
@dennisdoomen If you haven't already located it, In 5.4.2 NonGenericCollectionAssertions.BeEquivalentTo(IEnumerable expectation, string because = "", params object[] becauseArgs); In 5.5.1 it resolves to CollectionAssertions.BeEquivalentTo(params object[] expectations); |
Fixed in 5.5.2 |
Description
Version 5.5.1 fails existing test - used to to work in 5.4.2
Complete minimal example reproducing the issue
Checkout the following repo: https://github.com/LogoFX/logofx-client-mvvm-viewmodel
Run the Unit tests - all tests are green
Upgrade to 5.5.1
Run the Unit tests - now some are red.
Expected behavior:
Tests remain green
Actual behavior:
Some tests are red
Versions
The text was updated successfully, but these errors were encountered: