Explorar el Código

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

Brendan Forster hace 9 años
padre
commit
af05bd624e
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  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);
         }