Diff between Assert.AreEqual and Assert.AreSame?

前端 未结 2 460
孤独总比滥情好
孤独总比滥情好 2021-02-02 04:45

What is the difference between Assert.AreEqual and Assert.AreSame?

2条回答
  •  Happy的楠姐
    2021-02-02 05:25

    It means that AreSame() checks that they are the exact same object - if reference indicate the same object in memory.

    AreEqual() checks that objects has equal type and value. Equal objects can exist in two different places in memory.

提交回复
热议问题