XUnit Assertion for checking equality of objects
问题 I am using XUnit framework to test my C# code. Is there any assert method available in this framework which does the object comparison? My intention is to check for equality of each of the object's public and private member variables. I tried those alternatives but seldom it works: 1) bool IsEqual = (Obj1 == Obj2) 2) Assert.Same(Obj1, Obj2) which I couldnt understand what happens internally 回答1: You need to have a custom comparer to achieve this, when you compare objects otherwise they are