Assert.AreEqual和Assert.AreSame之间有区别吗? [英] Diff between Assert.AreEqual and Assert.AreSame?

查看:267
本文介绍了Assert.AreEqual和Assert.AreSame之间有区别吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Assert.AreEqual Assert.AreSame 有什么区别?

推荐答案

这意味着AreSame()检查它们是完全相同的对象-如果引用指示内存中的同一对象.

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

AreEqual()检查对象的类型和值是否相等.相等的对象可以存在于内存中的两个不同位置.

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

这篇关于Assert.AreEqual和Assert.AreSame之间有区别吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆