gpt4 book ai didi

c# - 比较 MbUnit 3.1 中的 2 个列表

转载 作者:太空宇宙 更新时间:2023-11-03 22:21:49 28 4
gpt4 key购买 nike

我正在尝试比较 2 个 Dictionary 对象在 MbUnit 3.1 中的相等性

Assert.AreEqual<FieldList>(expectedOutputFieldList, actualOutputFieldList);

其中 FieldList = Dictionary<string, object>

但是这会引发以下“错误”:

两个值在格式化时看起来相同,但它们是不同的实例。

有没有比较对象数据而不是实例的方法?

提前致谢...

最佳答案

尝试

Assert.AreElementsEqualIgnoringOrder(expectedOutputFieldList, actualOutputFieldList);

关于c# - 比较 MbUnit 3.1 中的 2 个列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2811072/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com