How to compare 2 lists in c#?
1st list,
DBvalues = [{ "_id" : ObjectId("5d98298f9110f5f13812f3c1"), "PartName" : null, "MAP" : null, "MPN" : null, "IsActive" : true, "Gtin" : "ab085347019069" }, { "_id" : ObjectId("5d98298f9110f5f13812f3c0"), "PartName" : null, "MAP" : null, "MPN" : null, "IsActive" : true, "Gtin" : "085347014064" }]
2nd list,
actualExcelvalues = [{ "_id" : ObjectId("5d98298f9110f5f13812f3c0"), "PartName" : null, "MAP" : null, "MPN" : null, "IsActive" : true, "Gtin" : "085347014064" }, { "_id" : ObjectId("5d98298f9110f5f13812f3c1"), "PartName" : null, "MAP" : null, "MPN" : null, "IsActive" : true, "Gtin" : "ab085347019069" }]
irrespective of their order/index.
What I have tried:
Tried,
1.)CollectionAssert.AreEqual(DBvalues, actualExcelvalues);
2.) CollectionAssert.AreEquivalent(DBvalues, actualExcelvalues);
Both returns false.