Summary
Introduce an Assert.AreSequenceEqual<T>(IEnumerable<T> actual, IEnumerable<T> expected) to allow assert on just generic IENumerables
Background and Motivation
Currently, neither Assert nor CollectionAssert have a good way to assert the equality of two IEnumerables<T>. One can use the CollectionAssert.AreEqual or CollectionAssert.AreEquivalent by calling ToList but that is not much fun (and its relying on CollectionAssert) so this is not ideal.
Proposed Feature
Add an AreSequenceEqual<T>(IEnumerable<T> actual, IEnumerable<T> expected) function on Assert to fill that API gap
Alternative Designs
One can use CollectionAssert by calling ToList or manually casting to ICollection but that certainly isn't great and also building on CollectionAssert :/
Summary
Introduce an
Assert.AreSequenceEqual<T>(IEnumerable<T> actual, IEnumerable<T> expected)to allow assert on just generic IENumerablesBackground and Motivation
Currently, neither
AssertnorCollectionAsserthave a good way to assert the equality of twoIEnumerables<T>. One can use theCollectionAssert.AreEqualorCollectionAssert.AreEquivalentby callingToListbut that is not much fun (and its relying onCollectionAssert) so this is not ideal.Proposed Feature
Add an
AreSequenceEqual<T>(IEnumerable<T> actual, IEnumerable<T> expected)function on Assert to fill that API gapAlternative Designs
One can use
CollectionAssertby callingToListor manually casting toICollectionbut that certainly isn't great and also building onCollectionAssert:/