比较 MbUnit 3.1 中的 2 个列表
我试图在 MbUnit 3.1 中比较 2 个 Dictionary 对象的相等性,如下所示
Assert.AreEqual<FieldList>(expectedOutputFieldList, actualOutputFieldList);
Where FieldList is = Dictionary
但是这会引发以下“错误”:
两个值看起来相同格式化时,但它们是不同的实例。
是否有任何方法可以比较对象数据而不是实例?
提前致谢...
I am trying to compare 2 Dictionary objects for equality in MbUnit 3.1 like so
Assert.AreEqual<FieldList>(expectedOutputFieldList, actualOutputFieldList);
Where FieldList is = Dictionary<string, object>
However this throws up the following "error":
Both values look the same when formatted but they are distinct instances.
Is there any method for comparing object data rather than instances?
Thanks in advance...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试
Try
毛里西奥是绝对正确的。但更一般地说,MbUnit v3 中有许多有用的断言可与集合和枚举一起使用。您可能想看看它们:
Mauricio is absolutely right. But more generally speaking, there are many useful assertions to be used with collections and enumerations in MbUnit v3. You may want to have a look at them: