Monthly Archives: January 2011

A Dynamic Equality Assertion Method in C#

Ever wanted to assert two objects were equal without having to manually compare their public properties one at a time? Now you can. This method asserts the equality of any two objects by comparing the values of all public, readable properties that have matching names and types. It will compare them even if the objects are different types. This may very well be the last object assertion method you will ever need!

Posted in .NET, C#, Testing | Tagged , , | 4 Responses