Compare if two sequences are equal
问题 Before marking this as duplicate because of its title please consider the following short program: static void Main() { var expected = new List<long[]> { new[] { Convert.ToInt64(1), Convert.ToInt64(999999) } }; var actual = DoSomething(); if (!actual.SequenceEqual(expected)) throw new Exception(); } static IEnumerable<long[]> DoSomething() { yield return new[] { Convert.ToInt64(1), Convert.ToInt64(999999) }; } I have a method which returns a sequence of arrays of type long. To test it I wrote