浏览代码

.Wait() bubbles up the wrong exception, rewrite this to correct assert

Brendan Forster 9 年之前
父节点
当前提交
af05bd624e
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      Ix.NET/Source/Tests/AsyncTests.Bugs.cs

+ 2 - 2
Ix.NET/Source/Tests/AsyncTests.Bugs.cs

@@ -117,7 +117,7 @@ namespace Tests
         }
 
         [Fact]
-        public void DisposesUponError()
+        public async Task DisposesUponError()
         {
             var disposed = new TaskCompletionSource<bool>();
 
@@ -130,7 +130,7 @@ namespace Tests
             var ys = xs.Select(x => { if (x == 1) throw ex; return x; });
 
             var e = ys.GetEnumerator();
-            AssertThrows<Exception>(() => e.MoveNext().Wait());
+            await Assert.ThrowsAsync<Exception>(() => e.MoveNext());
 
             Assert.True(disposed.Task.Result);
         }