Add deep (per property) object comparison to NUnit.
Available as a NuGet package: NUnit.DeepObjectCompare
To install NUnit.DeepObjectCompare, run the following command in the Package Manager Console
PM> Install-Package NUnit.DeepObjectCompare
using NUnit.DeepObjectCompare;
or
using Is = NUnit.DeepObjectCompare.Is;
Assert.That(actualObject, Is.DeepEqualTo(expectedObject));
Assert.That(actualObject, Is.Not.DeepEqualTo(expectedObject));
var comparisonConfig = new ComparisonConfig() { MembersToIgnore = new List<string>() {"Bar"} };
Assert.That(actualObject, Is.DeepEqualTo(expectedObject).WithComparisonConfig(comparisonConfig));
Use WithComparisonConfig or WithCompareLogic to configure the specifics of the comparison. See CompareNetObjects which is the excelent comparison engine used by NUnit.DeepObjectCompare
For more examples, check out the unit tests for these projects: