I think you should fix the DictionariesEqual class as well.

Multiple eyes on code is really good!


On Sun, Feb 16, 2014 at 8:00 PM, Rob Prouse <notifications@github.com>wrote:

> In src/framework/Constraints/NUnitEqualityComparer.cs:
>
> > @@ -143,6 +143,20 @@ public bool AreEqual(object x, object y, ref Tolerance tolerance)
> >
> >              if (x is IDictionary && y is IDictionary)
> >                  return DictionariesEqual((IDictionary)x, (IDictionary)y, ref tolerance);
> > +
> > +            // Issue #70 - EquivalentTo isn't compatible with IgnoreCase for dictionaries
> > +            // IDictionary will eventually try to compare it's key value pairs when using CollectionTally
> > +            if (xType.IsGenericType && xType.GetGenericTypeDefinition() == typeof(KeyValuePair<,>) &&
> > +                yType.IsGenericType && yType.GetGenericTypeDefinition() == typeof(KeyValuePair<,>))
> > +            {
> > +                var keyTolerance = Tolerance.Empty;
>
> Will do. If we do that though, should the code for DictionariesEqual in
> this class to be modified to act the same way? Currently it just passes in
> the existing tolerance. Here is the code from that method,
>
>         foreach (object key in x.Keys)
>             if (!AreEqual(x[key], y[key], ref tolerance))
>                 return false;
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/nunit/nunit-framework/pull/98/files#r9781839>
> .
>