jamesfoster/DeepEqual — pull request #7 by mperdeck (2014-03-23 05:49:25+00:00)
Title: New IgnoreProperty and DisregardListOrder

Hi James,

Thanks for creating this library! Love the way you structured it internally.

I added two features, that I needed for my unit testing. I believe these features will be of benefit to many users of DeepEqual.

1) New overload of IgnoreProperty. This allows you to specify a property name to ignore without specifying the object type. This is useful where you have objects with lots of different types in your object graph, but the name of the property to ignore is always the same.

I know I could get the same effect with the existing overloads of IgnoreProperty by having all the object types implement an interface, but that wasn't feasable in my case.

2) New feature DisregardListOrder. This is used in the list comparer. It allows you to disregard the order in which elements appear in the two lists being compared. It would cause:
1, 2, 3, 4
and
3, 2, 1, 4
to be considered the same.

This is very useful with database systems where the order in which collections of elements are retrieved is not guaranteed.

I added some documentation about these features to the readme.md file.