You can try overloading == in the class in question and use the generic overload "Assert.AreEqual <T>", which uses the equals operator.
Personally, I would prefer to use Assert.AreEqual(true,InstanceA.Equals(InstanceB))
, as this will definitely use your Equals method; of course, this assumes that you have checked the unit of your Equals method and are 100% sure that it works :)
As for why Assert uses object.Equals, I think we will need to ask the class designer :) But I suppose one of the reasons is that if your Equals method is wrong, your test result is not good.
source share