Ignoring Types
From Compare .NET Objects
Glossary Item Box
By default, the Compare .NET Objects Library will throw an exception if the class types are different. To compare classes that are different types, set Config.IgnoreObjectTypes = true
Example
RecipeDetail detail1 = new RecipeDetail(true, "Toffee");
detail1.Ingredient = "Crunchy Chocolate";
IndianRecipeDetail detail2 = new IndianRecipeDetail(true, "Toffee");
detail2.Ingredient = "Crunchy Chocolate";
CompareLogic compareLogic = new CompareLogic();
compareLogic.Config.IgnoreObjectTypes = true;
var result = compareLogic.Compare(detail1, detail2);
Assert.IsTrue(result.AreEqual, result.DifferencesString);