Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
public static void ShouldBeStructurallyEqualTo<T, U>(this IEnumerable<T> actual, IEnumerable<U> expected)
var actualList = actual.ToList();
var expectedList = expected.ToList();
bool isArrayOfValueType = typeof (T).IsArray && typeof (T).GetElementType().IsValueType;
foreach (var pair in actualList.Zip(expectedList, Tuple.Create))
if (isArrayOfValueType)
(pair.Item1 as IEnumerable).Should().BeEquivalentTo(pair.Item2 as IEnumerable);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment