NUnit Assert.Equals vs. Assert.AreEqual

偶尔善良 提交于 2019-12-08 14:42:10

问题


What is the difference between:

  • Assert.Equals and Assert.AreEqual
  • Assert.NotNull and Assert.IsNotNull
  • ...

?


回答1:


Just read the documentation:

NUnit - ConditionAsserts

Two forms are provided for the True, False, Null and NotNull conditions. The "Is" forms are compatible with earlier versions of the NUnit framework, while those without "Is" are provided for compatibility with NUnitLite.




回答2:


Assert.Equals is an object comparison

Assert.AreEquals is overloaded to compare (int,double, object) etc

Assert.NotNull and Assert.IsNotNul appear to be identical.

http://www.nunit.org/index.php?p=conditionAsserts&r=2.5.5



来源:https://stackoverflow.com/questions/6583633/nunit-assert-equals-vs-assert-areequal

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!