How to compare Lists in Unit Testing
I guess this will help
Assert.IsTrue(expected.SequenceEqual(actual));
To make assertions about collections, you should use CollectionAssert
:
CollectionAssert.AreEqual(expected, actual);
List<T>
doesn't override Equals
, so if Assert.AreEqual
just calls Equals
, it will end up using reference equality.