Bart De Smet 7 лет назад
Родитель
Сommit
969e2cd193

+ 9 - 1
Ix.NET/Source/System.Linq.Async.Tests/System/Linq/Operators/SequenceEqual.cs

@@ -172,7 +172,15 @@ namespace Tests
         public async Task SequenceEqual16Async()
         {
             var xs = new[] { 1, 2, -3, 4 }.ToAsyncEnumerable();
-            var ys = new[] { 1, -2, 3, 4 }.ToAsyncEnumerable();
+            var ys = new[] { 1, -2, 3, 4 }.ToAsyncEnumerable(); // NB: Implements IList<T>, resulting in optimized code path.
+            await Assert.ThrowsAsync<NotImplementedException>(() => xs.SequenceEqualAsync(ys, new EqEx()));
+        }
+
+        [Fact]
+        public async Task SequenceEqual17Async()
+        {
+            var xs = new[] { 1, 2, -3, 4 }.Select(x => x * 2).ToAsyncEnumerable();
+            var ys = new[] { 1, -2, 3, 4 }.Select(x => x * 2).ToAsyncEnumerable();
             var res = xs.SequenceEqualAsync(ys, new EqEx());
             await AssertThrowsAsync<NotImplementedException>(res);
         }