NUnit Nested Collection Comparison

前端 未结 2 2189
甜味超标
甜味超标 2021-02-20 12:45

Is there something similar to CollectionAssert.AreEquivalent() that works with nested collections?

The following code...

CollectionAssert.AreEquivalent (         


        
相关标签:
2条回答
  • 2021-02-20 13:11

    An old question, but somebody just posted a link to it on nunit-discuss...

    The failure is because the version of NUnit used did not support equality comparisons between two dictionaries and fell back on object comparison. Recent releases will not have this problem.

    0 讨论(0)
  • 2021-02-20 13:20

    You would need to write your own. However, if it were me I would try to write my Asserts in a different way so that if there was a difference in the two lists it was more obvious why/what was wrong.

    0 讨论(0)
提交回复
热议问题