I am working on Unit Testing for my current project and came across something odd. The .Net UnitTesting library has both Assert.Equals and Assert.AreEqual. The remarks for Assert.Equals say to use Assert.AreEqual to compare two objects, but gives no reason as to why to do so over Assert.Equals. Can somebody explain when you should use Assert.Equals in unit testing, if ever and the difference between Assert.Equals and Assert.AreEqual?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
Assert.Equals
is just theEquals
method inherited fromobject
. It has nothing to do with unit testing, and in fact, has no use.To be more precise,
Assert.Equals
is exactly the same asObject.Equals
.Object.Equals
has a use.However, if you're using
Assert.Equals
, then you're probably confusing it withAssert.AreEqual
, and you want to stop using it.