Support exception unwrapping for AsUniTask of Task.WhenAll

This commit is contained in:
hadashiA
2023-09-01 16:58:11 +09:00
parent 8eac07ad24
commit 6fb4f2d6d2
2 changed files with 8 additions and 5 deletions

View File

@@ -19,14 +19,17 @@ namespace NetCoreTests
{
await ThrowOrValueAsync().AsUniTask();
});
}
[Fact]
public async Task PropagateWhenAllException()
{
await Assert.ThrowsAsync<InvalidOperationException>(async () =>
{
await Task.WhenAll(ThrowAsync(), ThrowAsync(), ThrowAsync());
await Task.WhenAll(ThrowAsync(), ThrowAsync(), ThrowAsync()).AsUniTask();
});
}
async Task ThrowAsync()
{
throw new InvalidOperationException();