Assert.AreEqual dosn't works correctly for IEnumerable targets

Bug #1186689 reported by Sergey Limonov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
NUnit Framework
New
Undecided
Unassigned

Bug Description

Hi!

I've a class that implements IEnumerable interface and overrides the Eqauls(object obj) method. For this class Assert.AreEqual(object expected, object actual) doesn't calls overridden Equals method.

I investigate this issue by source code. I see that method

private bool AreEqual(object x, object y, EnumerableRecursionHelper recursionHelper, ref Tolerance tolerance)

defined in NUnitEqualityComparer doesn't calls Equals method of object if it implements IEnumerable.

I think it will be better if any special comparison will be called after calling Equals and last one returns false value.

Thanks,
Sergey

Revision history for this message
Sergey Limonov (sergey-limonov) wrote :

I've used NUnit 2.6.2

affects: nunitv2 → nunit-3.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.