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

后端 未结 10 1743
日久生厌
日久生厌 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 02:52

    One option is to write custom constraints to compare the items. Here's a nice article on the subject: http://www.davidarno.org/2012/07/25/improving-nunit-custom-constraints-with-syntax-helpers/

提交回复
热议问题