How to assert that two list contains elements with the same public properties in NUnit?

后端 未结 10 1903
日久生厌
日久生厌 2021-02-04 02:20

I want to assert that the elements of two list contains values that I expected, something like:

var foundCollection = fooManager.LoadFoo();
var expectedCollectio         


        
10条回答
  •  没有蜡笔的小新
    2021-02-04 03:00

    This solved my problem using NUnit's Assertion class from the NUnitCore assembly:

    AssertArrayEqualsByElements(list1.ToArray(), list2.ToArray());
    

提交回复
热议问题