Skip to content

Commit a7d7421

Browse files
committed
problem: ReceiveAsync can also throw TaskCanceledException
Solution, in the test, use ThrowsAny instead of Throws
1 parent cb3e082 commit a7d7421

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/NetMQ.Tests/ClientServer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public async void AsyncWithCancellationToken()
7979

8080
source.CancelAfter(100);
8181

82-
await Assert.ThrowsAsync<OperationCanceledException>(async () => await server.ReceiveStringAsync(source.Token));
82+
await Assert.ThrowsAnyAsync<OperationCanceledException>(async () => await server.ReceiveStringAsync(source.Token));
8383
}
8484

8585
#if NETCOREAPP3_1

0 commit comments

Comments
 (0)